Skip to content

Commit

Permalink
feature 1369 grid_weight_flag in EnsembleStat (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Jan 28, 2022
1 parent 7d7283f commit 3095217
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8760,6 +8760,11 @@ METplus Configuration Glossary

| *Used by:* EnsembleStat
ENSEMBLE_STAT_GRID_WEIGHT_FLAG
Specify the value for 'grid_weight_flag' in the MET configuration file for EnsembleStat.

| *Used by:* EnsembleStat
FCST_PCP_COMBINE_USE_ZERO_ACCUM
Only used if running PCPCombine wrapper with
:term:`FCST_PCP_COMBINE_METHOD` = SUBTRACT. If True, build a -subtract
Expand Down
13 changes: 13 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ METplus Configuration
| :term:`ENSEMBLE_STAT_MET_CONFIG_OVERRIDES`
| :term:`ENSEMBLE_STAT_ENS_MEMBER_IDS`
| :term:`ENSEMBLE_STAT_CONTROL_ID`
| :term:`ENSEMBLE_STAT_GRID_WEIGHT_FLAG`
| :term:`ENSEMBLE_STAT_VERIFICATION_MASK_TEMPLATE` (optional)
| :term:`ENS_VAR<n>_NAME` (optional)
| :term:`ENS_VAR<n>_LEVELS` (optional)
Expand Down Expand Up @@ -890,6 +891,18 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`ENSEMBLE_STAT_MET_CONFIG_OVERRIDES`
- n/a

**${METPLUS_GRID_WEIGHT_FLAG}**

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

* - METplus Config(s)
- MET Config File
* - :term:`ENSEMBLE_STAT_GRID_WEIGHT_FLAG`
- grid_weight_flag


.. _example_wrapper:

Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,9 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
({'ENSEMBLE_STAT_CONTROL_ID': '0', },
{'METPLUS_CONTROL_ID': 'control_id = "0";'}),
({'ENSEMBLE_STAT_GRID_WEIGHT_FLAG': 'COS_LAT', },
{'METPLUS_GRID_WEIGHT_FLAG': 'grid_weight_flag = COS_LAT;'}),
]
)
def test_ensemble_stat_single_field(metplus_config, config_overrides,
Expand Down
6 changes: 6 additions & 0 deletions metplus/wrappers/ensemble_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class EnsembleStatWrapper(CompareGriddedWrapper):
'METPLUS_OBS_QUALITY_EXC',
'METPLUS_ENS_MEMBER_IDS',
'METPLUS_CONTROL_ID',
'METPLUS_GRID_WEIGHT_FLAG',
]

# handle deprecated env vars used pre v4.0.0
Expand Down Expand Up @@ -330,6 +331,11 @@ def create_c_dict(self):
self.add_met_config(name='control_id',
data_type='string')

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

# old method of setting MET config values
c_dict['ENS_THRESH'] = (
self.config.getstr('config', 'ENSEMBLE_STAT_ENS_THRESH', '1.0')
Expand Down
4 changes: 3 additions & 1 deletion parm/met_config/EnsembleStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ rng = {

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

grid_weight_flag = NONE;
//grid_weight_flag =
${METPLUS_GRID_WEIGHT_FLAG}

${METPLUS_OUTPUT_PREFIX}
//version = "V9.0";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ ENSEMBLE_STAT_ENSEMBLE_FLAG_WEIGHT = FALSE

#ENSEMBLE_STAT_ENS_MEMBER_IDS =
#ENSEMBLE_STAT_CONTROL_ID =

#ENSEMBLE_STAT_GRID_WEIGHT_FLAG =

0 comments on commit 3095217

Please sign in to comment.