You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once #33 is merged, we will have much more flexibility in how we store data in the config file. Using bash scripts restricts us to reading a flat dictionary of variables, while python run scripts allow us to read multi-level dictionaries. We can use this to solve several open issues by introducing new sections and subsections to the config.yaml file
#35, allowing multiple obs types for a single field
To solve #35, we can introduce a new top-level config section
obs: will have a subsection for each observation type
This will allow us to migrate a lot of the clunky obs-specific variables out of the top-level verification: section. For example verification: CCPA_OBS_AVAIL_INTVL_HRS could now be obs:CCPA:file_interval, verification:CCPA_OBS_DIR could now be obs:CCPA:staging_dir or something similar
The OBS_*_FN_TEMPLATES variables could now be a proper dictionary in each instead of a hacky list
Here is an example of what this could look like:
obs:
CCPA:
file_interval: 3600 # This could be specified in seconds rather than hours, to allow future sub-hourly verification capabilities
data_store: hpss # Instead of `verification: OBS_DATA_STORE_CCPA: hpss`
APCP:
fn_template: '{valid?fmt=%Y%m%d}/ccpa.t{valid?fmt=%H}z.{{ "%02d" % verification.CCPA_OBS_AVAIL_INTVL_HRS / 3600 }}h.hrap.conus.gb2'
MRMS:
file_interval: 3600
irregular_times: True # This setting would invoke calls to `select_validtime_obs()` to select the appropriate observation file for obs like MRMS that are at irregular times. Currently this is hard-coded for certain ob types in `scripts/get_obs.py`
REFC:
fn_template: '{valid?fmt=%Y%m%d}/MergedReflectivityQCComposite_00.50_{valid?fmt=%Y%m%d}-{valid?fmt=%H%M%S}.grib2'
RETOP:
fn_template: '{valid?fmt=%Y%m%d}/EchoTop_18_00.50_{valid?fmt=%Y%m%d}-{valid?fmt=%H%M%S}.grib2'
#17, allow specification of threshold data in the config file
To solve #17, we can introduce another new top-level config section fields:, with a subsection for each field type
we can move all the information currently found in [parm/metplus/vx_configs](https://github.com/dtcenter/dtc-vx-workflow/tree/develop/parm/metplus/vx_configs) into this new config section
Note: in the current dictionary there is some complex string-splitting logic to associate the observation field name with the forecast field name. This requires a lot of unnecessary and complex python logic that we can get rid of by just rearranging into the above dictionary structure. While it's somewhat arbitrary which level of the dictionary specifies the name (observation files vs forecast files), it is important that there is a direct one-to-one association. Deciding to use the observation type name at the top-level key and using "fcst_field_name:" as a key underneath that level means that in the future we may be able to specify different observation type names for different ensemble forecast files (see #20).It turns out this does not work: because the observation name can be the same for different model fields, we need to use the forecast field as the dictionary key to avoid duplicate keys (which are disallowed)
If not specified, fields such as obs_field_name, obs_level_name, etc. would default to the same as the forecast value.
The way I envision this working is:
we will only have one set of default thresholds, taken from vx_config_det.yaml. We can give examples of different thresholds that are currently stored in the other files in WE2E tests where appropriate
This process will deprecate the variables VX_CONFIG_DET_FN, VX_CONFIG_ENS_FN
The only downside of this approach I can see is that we can no longer have different thresholds for verifying the individual members vs the whole ensemble. Is that functionality we envision needing?
Code we can remove
ush/set_vx_params.py Any information that is coming from this file can instead be assigned in one of these new config sections
parm/metplus/metplus_macros.jinja: can be replaced with logic in make_var_lists; this makes for easier to understand variable construction
Description
Once #33 is merged, we will have much more flexibility in how we store data in the config file. Using bash scripts restricts us to reading a flat dictionary of variables, while python run scripts allow us to read multi-level dictionaries. We can use this to solve several open issues by introducing new sections and subsections to the config.yaml file
#35, allowing multiple obs types for a single field
To solve #35, we can introduce a new top-level config section
obs:will have a subsection for each observation typeverification:section. For exampleverification: CCPA_OBS_AVAIL_INTVL_HRScould now beobs:CCPA:file_interval,verification:CCPA_OBS_DIRcould now beobs:CCPA:staging_diror something similarOBS_*_FN_TEMPLATESvariables could now be a proper dictionary in each instead of a hacky listHere is an example of what this could look like:
#17, allow specification of threshold data in the config file
To solve #17, we can introduce another new top-level config section
fields:, with a subsection for each field type[parm/metplus/vx_configs](https://github.com/dtcenter/dtc-vx-workflow/tree/develop/parm/metplus/vx_configs)into this new config sectionHere is an example of what this could look like:
Current:
Proposed new:
Note: in the current dictionary there is some complex string-splitting logic to associate the observation field name with the forecast field name. This requires a lot of unnecessary and complex python logic that we can get rid of by just rearranging into the above dictionary structure.
While it's somewhat arbitrary which level of the dictionary specifies the name (observation files vs forecast files), it is important that there is a direct one-to-one association. Deciding to use the observation type name at the top-level key and using "fcst_field_name:" as a key underneath that level means that in the future we may be able to specify different observation type names for different ensemble forecast files (see #20).It turns out this does not work: because the observation name can be the same for different model fields, we need to use the forecast field as the dictionary key to avoid duplicate keys (which are disallowed)If not specified, fields such as
obs_field_name,obs_level_name, etc. would default to the same as the forecast value.The way I envision this working is:
vx_config_det.yaml. We can give examples of different thresholds that are currently stored in the other files in WE2E tests where appropriateVX_CONFIG_DET_FN,VX_CONFIG_ENS_FNThe only downside of this approach I can see is that we can no longer have different thresholds for verifying the individual members vs the whole ensemble. Is that functionality we envision needing?Code we can remove
ush/set_vx_params.pyAny information that is coming from this file can instead be assigned in one of these new config sectionsparm/metplus/metplus_macros.jinja: can be replaced with logic inmake_var_lists; this makes for easier to understand variable constructionOther improvements
verification: OBS_CCPA_APCP_FN_TEMPLATE_PCPCOMBINE_OUTPUT: 'xyzabc'can become `pcpcombine: output_fn: APCP: 'xyzabc'verification: AIRNOW_INPUT_FORMAT: "airnowhourlyaqobs"can becomefield: AIRNOW: format: "airnowhourlyaqobs"Examples
Here are a few examples of how our current config files would translate to this new format: (will work on this later)