Skip to content

Commit

Permalink
Per #2727, add support for obtype_as_group_val_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Oct 15, 2024
1 parent dd5048a commit 760c986
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12980,3 +12980,13 @@ METplus Configuration Glossary
Specify the value for 'point_weight_flag' in the MET configuration file for EnsembleStat.

| *Used by:* EnsembleStat
POINT_STAT_OBTYPE_AS_GROUP_VAL_FLAG
Specify the value for 'obtype_as_group_val_flag' in the MET configuration file for PointStat.

| *Used by:* PointStat
ENSEMBLE_STAT_OBTYPE_AS_GROUP_VAL_FLAG
Specify the value for 'obtype_as_group_val_flag' in the MET configuration file for EnsembleStat.

| *Used by:* EnsembleStat
28 changes: 27 additions & 1 deletion docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ METplus Configuration
| :term:`ENSEMBLE_STAT_CUSTOM_LOOP_LIST`
| :term:`ENSEMBLE_STAT_SKIP_IF_OUTPUT_EXISTS`
| :term:`ENSEMBLE_STAT_DESC`
| :term:`ENSEMBLE_STAT_OBTYPE_AS_GROUP_VAL_FLAG`
| :term:`ENSEMBLE_STAT_ENS_SSVAR_BIN_SIZE`
| :term:`ENSEMBLE_STAT_ENS_PHIST_BIN_SIZE`
| :term:`ENSEMBLE_STAT_CLIMO_CDF_BINS`
Expand Down Expand Up @@ -850,6 +851,18 @@ ${METPLUS_OBS_ERROR_FLAG}
* - :term:`ENSEMBLE_STAT_OBS_ERROR_FLAG`
- obs_error.flag

${METPLUS_OBTYPE_AS_GROUP_VAL_FLAG}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

* - METplus Config(s)
- MET Config File
* - :term:`ENSEMBLE_STAT_OBTYPE_AS_GROUP_VAL_FLAG`
- obtype_as_group_val_flag

${METPLUS_ENS_SSVAR_BIN_SIZE}
"""""""""""""""""""""""""""""

Expand Down Expand Up @@ -7083,6 +7096,7 @@ Configuration
| :term:`POINT_STAT_HIRA_SHAPE`
| :term:`POINT_STAT_HIRA_PROB_CAT_THRESH`
| :term:`POINT_STAT_MESSAGE_TYPE_GROUP_MAP`
| :term:`POINT_STAT_OBTYPE_AS_GROUP_VAL_FLAG`
| :term:`FCST_POINT_STAT_IS_PROB`
| :term:`FCST_POINT_STAT_PROB_IN_GRIB_PDS`
| :term:`FCST_POINT_STAT_WINDOW_BEGIN`
Expand Down Expand Up @@ -7486,7 +7500,19 @@ ${METPLUS_MESSAGE_TYPE_GROUP_MAP}
- MET Config File
* - :term:`POINT_STAT_MESSAGE_TYPE_GROUP_MAP`
- message_type_group_map


${METPLUS_OBTYPE_AS_GROUP_VAL_FLAG}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

* - METplus Config(s)
- MET Config File
* - :term:`POINT_STAT_OBTYPE_AS_GROUP_VAL_FLAG`
- obtype_as_group_val_flag

${METPLUS_CLIMO_MEAN_DICT}
""""""""""""""""""""""""""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,8 @@ def test_ensemble_stat_field_info(metplus_config, config_overrides,
'hour_interval = 12;}')}),
({'ENSEMBLE_STAT_POINT_WEIGHT_FLAG': 'SID', },
{'METPLUS_POINT_WEIGHT_FLAG': 'point_weight_flag = SID;'}),
({'ENSEMBLE_STAT_OBTYPE_AS_GROUP_VAL_FLAG': 'FALSE', },
{'METPLUS_OBTYPE_AS_GROUP_VAL_FLAG': 'obtype_as_group_val_flag = FALSE;'}),
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,8 @@ def test_met_dictionary_in_var_options(metplus_config):
'hour_interval = 12;}')}),
({'POINT_STAT_POINT_WEIGHT_FLAG': 'SID', },
{'METPLUS_POINT_WEIGHT_FLAG': 'point_weight_flag = SID;'}),
({'POINT_STAT_OBTYPE_AS_GROUP_VAL_FLAG': 'FALSE', },
{'METPLUS_OBTYPE_AS_GROUP_VAL_FLAG': 'obtype_as_group_val_flag = FALSE;'}),
]
)
@pytest.mark.wrapper_a
Expand Down
3 changes: 3 additions & 0 deletions metplus/wrappers/ensemble_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class EnsembleStatWrapper(CompareGriddedWrapper):
'METPLUS_PROB_CAT_THRESH',
'METPLUS_PROB_PCT_THRESH',
'METPLUS_ECLV_POINTS',
'METPLUS_OBTYPE_AS_GROUP_VAL_FLAG',
]

# deprecated env vars that are no longer supported in the wrapped MET conf
Expand Down Expand Up @@ -268,6 +269,8 @@ def create_c_dict(self):
extra_args={'remove_quotes': True,
'allow_empty': True})

self.add_met_config(name='obtype_as_group_val_flag', data_type='bool')

self.add_met_config(name='ens_ssvar_bin_size', data_type='float')

self.add_met_config(name='ens_phist_bin_size', data_type='float')
Expand Down
3 changes: 3 additions & 0 deletions metplus/wrappers/point_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class PointStatWrapper(CompareGriddedWrapper):
'METPLUS_HSS_EC_VALUE',
'METPLUS_HIRA_DICT',
'METPLUS_MESSAGE_TYPE_GROUP_MAP',
'METPLUS_OBTYPE_AS_GROUP_VAL_FLAG',
'METPLUS_FCST_FILE_TYPE',
'METPLUS_OBS_FILE_TYPE',
'METPLUS_SEEPS_P1_THRESH',
Expand Down Expand Up @@ -280,6 +281,8 @@ def create_c_dict(self):
self.add_met_config(name='message_type_group_map', data_type='list',
extra_args={'remove_quotes': True})

self.add_met_config(name='obtype_as_group_val_flag', data_type='bool')

self.add_met_config(name='seeps_p1_thresh', data_type='string',
extra_args={'remove_quotes': True})

Expand Down
3 changes: 3 additions & 0 deletions parm/met_config/EnsembleStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ message_type_group_map = [
{ key = "ONLYSF"; val = "ADPSFC,SFCSHP"; }
];

//obtype_as_group_val_flag =
${METPLUS_OBTYPE_AS_GROUP_VAL_FLAG}

//
// Ensemble bin sizes
// May be set separately in each "obs.field" entry
Expand Down
3 changes: 3 additions & 0 deletions parm/met_config/PointStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ ${METPLUS_OBS_PERC_VALUE}
//message_type_group_map =
${METPLUS_MESSAGE_TYPE_GROUP_MAP}

//obtype_as_group_val_flag =
${METPLUS_OBTYPE_AS_GROUP_VAL_FLAG}

////////////////////////////////////////////////////////////////////////////////

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ ENSEMBLE_STAT_SKIP_CONST = False

ENSEMBLE_STAT_OBS_ERROR_FLAG = FALSE

#ENSEMBLE_STAT_OBTYPE_AS_GROUP_VAL_FLAG =

ENSEMBLE_STAT_ENS_SSVAR_BIN_SIZE = 1.0
ENSEMBLE_STAT_ENS_PHIST_BIN_SIZE = 0.05

Expand Down
1 change: 1 addition & 0 deletions parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ POINT_STAT_MESSAGE_TYPE = ADPUPA, ADPSFC
#POINT_STAT_HIRA_PROB_CAT_THRESH =

#POINT_STAT_MESSAGE_TYPE_GROUP_MAP =
#POINT_STAT_OBTYPE_AS_GROUP_VAL_FLAG =

#POINT_STAT_UGRID_DATASET =
#POINT_STAT_UGRID_MAX_DISTANCE_KM =
Expand Down

0 comments on commit 760c986

Please sign in to comment.