Refactoring of molecular atmospheric calibration
Summary
Currently, the state of molecular atmospheric calibration reflects its historical evolution and the addition of functionalities.
- The creation of the data requests is taking place inside the code, and most of the configuration file is hard coded.
- The retrieval, decoding and conversion of the grib2 files is ok.
- Then the calibrate function creates an atmospheric profile of molecular number density, refractive index and water vapour. This profile it is a contemporary one, but with a tuning of the timeseries for data retrieval can be considered as a mockup reference atmosphere.
- Additionally, the calibrate function returns an enum variable with the atmospheric model (summer, winter or intermediate). The selection is based on the current date and the definition of the season for the South & North observatories.
What is the expected correct behavior?
Since we decided to implement the real thing for DPPS release 0, and in the view of the decomposition to atomised usecases, a refactoring is needed.
- The creation of the request (in principle it is a dictionary) will take place in a dedicated module in the refactored molecular profiles package. It will handle both GDAS & ECMWF. We should and will provide an example configuration tailored to the current CalibPipe needs, but all configuration should be user defined (see also https://gitlab.cta-observatory.org/cta-array-elements/ccf/mdps/-/work_items/4606)
- The calibrate function will be split in 2 parts
-
Creation of a contemporary molecular density profile. The functionality is in principle there. This is the implementation of the usecase UC-DPPS-CP-115
-
Selection of a reference (molecular density or in general atmospheric? We have to decide at last, some discussion with the experts is needed) profile. For this we need a matching algorithm. We haven't been supplied with one yet (is TBD in level B reqs) however we can create a plausible one. The part of choosing a model based on the current date will be retained as an implementation of the exception scenario of UC-DPPS-CP-112. Obviously the selection of seasons for the South and North Hemispheres should looked a bit more carefully for the final product.
We should provide a command line tool for each of the above 2 parts. For part 1, a new Tool named create_contemporary_MDP will be provided. It will include the functionality of the convert_grib2.py Tool as well.
For the 2nd part we will modify the select_MDP tool.
IMHO, we should keep a separate convert_grib2.py Tool despite its functionality will be included in the new create_contemporary_MDP. The convert_grib2.py can potentially be a useful building block for a workflow.
I also think that the molecular_atmosphere_full_workflow.py should be also kept.