Skip to content

Commit

Permalink
per #896, added support for setting fourier dictionary in a GridStat …
Browse files Browse the repository at this point in the history
…MET config file
  • Loading branch information
georgemccabe committed Dec 7, 2021
1 parent dd0d474 commit 2363fb9
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8529,3 +8529,13 @@ METplus Configuration Glossary
Specify the value for 'obs_quality_exc' in the MET configuration file for EnsembleStat.

| *Used by:* EnsembleStat
GRID_STAT_FOURIER_WAVE_1D_BEG
Specify the value for 'fourier.wave_1d_beg' in the MET configuration file for GridStat.

| *Used by:* GridStat
GRID_STAT_FOURIER_WAVE_1D_END
Specify the value for 'fourier.wave_1d_end' in the MET configuration file for GridStat.

| *Used by:* GridStat
15 changes: 15 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2800,6 +2800,8 @@ METplus Configuration
| :term:`GRID_STAT_DISTANCE_MAP_FOM_ALPHA`
| :term:`GRID_STAT_DISTANCE_MAP_ZHU_WEIGHT`
| :term:`GRID_STAT_DISTANCE_MAP_BETA_VALUE_N`
| :term:`GRID_STAT_FOURIER_WAVE_1D_BEG`
| :term:`GRID_STAT_FOURIER_WAVE_1D_END`
| :term:`GRID_STAT_MASK_GRID` (optional)
| :term:`GRID_STAT_MASK_POLY` (optional)
| :term:`GRID_STAT_MET_CONFIG_OVERRIDES`
Expand Down Expand Up @@ -3266,6 +3268,19 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`GRID_STAT_DISTANCE_MAP_BETA_VALUE_N`
- distance_map.beta_value(n)

**${METPLUS_FOURIER_DICT}**

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

* - METplus Config(s)
- MET Config File
* - :term:`GRID_STAT_FOURIER_WAVE_1D_BEG`
- fourier.wave_1d_beg
* - :term:`GRID_STAT_FOURIER_WAVE_1D_END`
- fourier.wave_1d_end

.. _ioda2nc_wrapper:

IODA2NC
Expand Down
10 changes: 10 additions & 0 deletions internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,16 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
'baddeley_max_dist = 2.3;'
'fom_alpha = 4.5;zhu_weight = 0.5;'
'beta_value(n) = n * n / 3.0;}')}),
({'GRID_STAT_FOURIER_WAVE_1D_BEG': '0,4,10', },
{'METPLUS_FOURIER_DICT': 'fourier = {wave_1d_beg = [0, 4, 10];}'}),
({'GRID_STAT_FOURIER_WAVE_1D_END': '3,9,20', },
{'METPLUS_FOURIER_DICT': 'fourier = {wave_1d_end = [3, 9, 20];}'}),
({'GRID_STAT_FOURIER_WAVE_1D_BEG': '0,4,10',
'GRID_STAT_FOURIER_WAVE_1D_END': '3,9,20',},
{'METPLUS_FOURIER_DICT': ('fourier = {wave_1d_beg = [0, 4, 10];'
'wave_1d_end = [3, 9, 20];}')}),
]
)
Expand Down
6 changes: 6 additions & 0 deletions metplus/wrappers/grid_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class GridStatWrapper(CompareGriddedWrapper):
'METPLUS_OBS_FILE_TYPE',
'METPLUS_HSS_EC_VALUE',
'METPLUS_DISTANCE_MAP_DICT',
'METPLUS_FOURIER_DICT',
]

# handle deprecated env vars used pre v4.0.0
Expand Down Expand Up @@ -246,6 +247,11 @@ def create_c_dict(self):
'beta_value(n)': ('string', 'remove_quotes'),
})

self.add_met_config_dict('fourier', {
'wave_1d_beg': ('list', 'remove_quotes'),
'wave_1d_end': ('list', 'remove_quotes'),
})

return c_dict

def set_environment_variables(self, time_info):
Expand Down
6 changes: 2 additions & 4 deletions parm/met_config/GridStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ nbrhd = {
// Fourier decomposition
// May be set separately in each "obs.field" entry
//
fourier = {
wave_1d_beg = [];
wave_1d_end = [];
}
//fourier = {
${METPLUS_FOURIER_DICT}

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

Expand Down
3 changes: 3 additions & 0 deletions parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,6 @@ GRID_STAT_NC_PAIRS_FLAG_APPLY_MASK = FALSE
#GRID_STAT_DISTANCE_MAP_FOM_ALPHA =
#GRID_STAT_DISTANCE_MAP_ZHU_WEIGHT =
#GRID_STAT_DISTANCE_MAP_BETA_VALUE_N =

#GRID_STAT_FOURIER_WAVE_1D_BEG =
#GRID_STAT_FOURIER_WAVE_1D_END =

0 comments on commit 2363fb9

Please sign in to comment.