Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature 1369 grid_weight_flag in EnsembleStat #1379

Merged
merged 2 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8759,3 +8759,8 @@ METplus Configuration Glossary
:term:`ENSEMBLE_STAT_ENS_VLD_THRESH`.

| *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
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 =