Skip to content

Commit

Permalink
per #1816, removed ens dictionary from EnsembleStat, moved ens.vld_th…
Browse files Browse the repository at this point in the history
…resh and ens.ens_thresh to fcst dictionary, moved ens.obs_thresh to top level
  • Loading branch information
georgemccabe committed Sep 20, 2022
1 parent 4af5d05 commit 73cc205
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 237 deletions.
17 changes: 13 additions & 4 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -984,12 +984,18 @@ METplus Configuration Glossary
| *Used by:* EnsembleStat
ENSEMBLE_STAT_ENS_VLD_THRESH
.. warning:: **DEPRECATED:** Please use :term:`ENSEMBLE_STAT_VLD_THRESH` instead.

ENSEMBLE_STAT_VLD_THRESH
Threshold for the ratio of the number of valid data values to the total number of expected ensemble members. This value is passed into the ensemble_stat config file to make sure the percentage of files that are valid meets the expectation.

| *Used by:* EnsembleStat
ENSEMBLE_STAT_ENS_OBS_THRESH
Sets the ens.obs_thresh value in the ensemble_stat MET config file.
.. warning:: **DEPRECATED:** Please use :term:`ENSEMBLE_STAT_OBS_THRESH`.

ENSEMBLE_STAT_OBS_THRESH
Sets the obs_thresh value in the ensemble_stat MET config file.

| *Used by:* EnsembleStat
Expand Down Expand Up @@ -6312,9 +6318,12 @@ METplus Configuration Glossary
| *Used by:* TCpairs
ENS_ENSEMBLE_STAT_INPUT_DATATYPE
Set the file_type entry of the ens dictionary in the MET config file for EnsembleStat.
.. warning:: **DEPRECATED:** Please use :term:`GEN_ENS_PROD_INPUT_DATATYPE` in :ref:`gen_ens_prod_wrapper` instead.

| *Used by:* EnsembleStat
GEN_ENS_PROD_INPUT_DATATYPE
Set the file_type entry of the ens dictionary in the MET config file for GenEnsProd.

| *Used by:* GenEnsProd
FCST_SERIES_ANALYSIS_INPUT_DATATYPE
Set the file_type entry of the fcst dictionary in the MET config file for SeriesAnalysis.
Expand Down Expand Up @@ -9178,7 +9187,7 @@ METplus Configuration Glossary
it will automatically be removed by the wrapper to prevent an error in the
MET tool. This may require adjusting the value for
:term:`ENSEMBLE_STAT_N_MEMBERS` and/or
:term:`ENSEMBLE_STAT_ENS_VLD_THRESH`.
:term:`ENSEMBLE_STAT_VLD_THRESH`.

| *Used by:* EnsembleStat
Expand Down
18 changes: 9 additions & 9 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ METplus Configuration
| :term:`OBS_ENSEMBLE_STAT_FILE_WINDOW_BEGIN`
| :term:`OBS_ENSEMBLE_STAT_FILE_WINDOW_END`
| :term:`ENSEMBLE_STAT_ENS_THRESH`
| :term:`ENSEMBLE_STAT_ENS_VLD_THRESH`
| :term:`ENSEMBLE_STAT_ENS_OBS_THRESH`
| :term:`ENSEMBLE_STAT_VLD_THRESH`
| :term:`ENSEMBLE_STAT_OBS_THRESH`
| :term:`ENSEMBLE_STAT_CUSTOM_LOOP_LIST`
| :term:`ENSEMBLE_STAT_SKIP_IF_OUTPUT_EXISTS`
| :term:`ENSEMBLE_STAT_DESC`
Expand Down Expand Up @@ -435,29 +435,29 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - METplus Config(s)
- MET Config File
* - :term:`ENSEMBLE_STAT_ENS_THRESH`
- ens.ens_thresh
- fcst.ens_thresh

**${METPLUS_ENS_VLD_THRESH}**
**${METPLUS_VLD_THRESH}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`ENSEMBLE_STAT_ENS_VLD_THRESH`
- ens.vld_thresh
* - :term:`ENSEMBLE_STAT_VLD_THRESH`
- fcst.vld_thresh

**${METPLUS_ENS_OBS_THRESH}**
**${METPLUS_OBS_THRESH}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`ENSEMBLE_STAT_ENS_OBS_THRESH`
- ens.obs_thresh
* - :term:`ENSEMBLE_STAT_OBS_THRESH`
- obs_thresh

**${METPLUS_ENS_FIELD}**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
obs_name = 'APCP_03'
obs_level_no_quotes = '(*,*)'
obs_level = f'"{obs_level_no_quotes}"'
ens_name = 'REFC'
ens_level = 'L0'
fcst_fmt = f'field = [{{ name="{fcst_name}"; level="{fcst_level}"; }}];'
obs_fmt = (f'field = [{{ name="{obs_name}"; '
f'level="{obs_level_no_quotes}"; }}];')
ens_fmt = f'field = [{{ name="{ens_name}"; level="{ens_level}"; }}];'

time_fmt = '%Y%m%d%H'
run_times = ['2005080700', '2005080712']
Expand Down Expand Up @@ -60,44 +57,17 @@ def set_minimum_config_settings(config, set_fields=True):
config.set('config', 'FCST_VAR1_LEVELS', fcst_level)
config.set('config', 'OBS_VAR1_NAME', obs_name)
config.set('config', 'OBS_VAR1_LEVELS', obs_level)
config.set('config', 'ENS_VAR1_NAME', ens_name)
config.set('config', 'ENS_VAR1_LEVELS', ens_level)


@pytest.mark.parametrize(
'config_overrides, env_var_values', [
# 0 : 3 ens, 1 fcst, 1 obs
({'ENS_VAR1_NAME': 'ens_name_1',
'ENS_VAR1_LEVELS': 'ENS_LEVEL_1',
'ENS_VAR2_NAME': 'ens_name_2',
'ENS_VAR2_LEVELS': 'ENS_LEVEL_2A, ENS_LEVEL_2B',
'FCST_VAR1_NAME': 'fcst_name_1',
'FCST_VAR1_LEVELS': 'FCST_LEVEL_1',
'OBS_VAR1_NAME': 'obs_name_1',
'OBS_VAR1_LEVELS': 'OBS_LEVEL_1',
},
{'METPLUS_ENS_FIELD': ('field = ['
'{ name="ens_name_1"; level="ENS_LEVEL_1"; },'
'{ name="ens_name_2"; level="ENS_LEVEL_2A"; },'
'{ name="ens_name_2"; level="ENS_LEVEL_2B"; }'
'];'),
'METPLUS_FCST_FIELD': ('field = ['
'{ name="fcst_name_1"; level="FCST_LEVEL_1"; }'
'];'),
'METPLUS_OBS_FIELD': ('field = ['
'{ name="obs_name_1"; level="OBS_LEVEL_1"; }'
'];'),
}),
# 1 : no ens, 1 fcst, 1 obs -- use fcst for ens
# 0 : no ens, 1 fcst, 1 obs
({'FCST_VAR1_NAME': 'fcst_name_1',
'FCST_VAR1_LEVELS': 'FCST_LEVEL_1',
'OBS_VAR1_NAME': 'obs_name_1',
'OBS_VAR1_LEVELS': 'OBS_LEVEL_1',
},
{'METPLUS_ENS_FIELD': ('field = ['
'{ name="fcst_name_1"; level="FCST_LEVEL_1"; }'
'];'),
'METPLUS_FCST_FIELD': ('field = ['
{'METPLUS_FCST_FIELD': ('field = ['
'{ name="fcst_name_1"; level="FCST_LEVEL_1"; }'
'];'),
'METPLUS_OBS_FIELD': ('field = ['
Expand Down Expand Up @@ -580,6 +550,14 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
({'ENSEMBLE_STAT_ECLV_POINTS': '0.05', },
{'METPLUS_ECLV_POINTS': 'eclv_points = 0.05;'}),
({'ENSEMBLE_STAT_ENS_THRESH': '0.1', },
{'METPLUS_ENS_THRESH': 'ens_thresh = 0.1;'}),
({'ENSEMBLE_STAT_VLD_THRESH': '0.5', },
{'METPLUS_VLD_THRESH': 'vld_thresh = 0.5;'}),
({'ENSEMBLE_STAT_OBS_THRESH': 'NA, 0.5', },
{'METPLUS_OBS_THRESH': 'obs_thresh = [NA, 0.5];'}),
]
)
@pytest.mark.wrapper_c
Expand Down Expand Up @@ -633,8 +611,6 @@ def test_ensemble_stat_single_field(metplus_config, config_overrides,
assert(actual_value == fcst_fmt)
elif env_var_key == 'METPLUS_OBS_FIELD':
assert (actual_value == obs_fmt)
elif env_var_key == 'METPLUS_ENS_FIELD':
assert (actual_value == ens_fmt)
else:
assert(env_var_values.get(env_var_key, '') == actual_value)

Expand Down
Loading

0 comments on commit 73cc205

Please sign in to comment.