Skip to content

Commit

Permalink
per #896, add support for setting ps_plot_flag and ct_stats_flag in M…
Browse files Browse the repository at this point in the history
…ODE wrapped MET config file
  • Loading branch information
georgemccabe committed Dec 16, 2021
1 parent 15ee427 commit 3a40b14
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.
10 changes: 10 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8653,3 +8653,13 @@ METplus Configuration Glossary
Specify the value for 'output_stats.prc' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis
MODE_PS_PLOT_FLAG
Specify the value for 'ps_plot_flag' in the MET configuration file for MODE.

| *Used by:* MODE
MODE_CT_STATS_FLAG
Specify the value for 'ct_stats_flag' in the MET configuration file for MODE.

| *Used by:* MODE
22 changes: 22 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3941,6 +3941,8 @@ METplus Configuration
| :term:`MODE_INTEREST_FUNCTION_CENTROID_DIST`
| :term:`MODE_INTEREST_FUNCTION_BOUNDARY_DIST`
| :term:`MODE_INTEREST_FUNCTION_CONVEX_HULL_DIST`
| :term:`MODE_PS_PLOT_FLAG`
| :term:`MODE_CT_STATS_FLAG`
| :term:`FCST_MODE_VAR<n>_NAME` (optional)
| :term:`FCST_MODE_VAR<n>_LEVELS` (optional)
| :term:`FCST_MODE_VAR<n>_THRESH` (optional)
Expand Down Expand Up @@ -4455,7 +4457,27 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`MODE_TOTAL_INTEREST_THRESH`
- total_interest_thresh

**${METPLUS_PS_PLOT_FLAG}**

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

* - METplus Config(s)
- MET Config File
* - :term:`MODE_PS_PLOT_FLAG`
- ps_plot_flag

**${METPLUS_CT_STATS_FLAG}**

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

* - METplus Config(s)
- MET Config File
* - :term:`MODE_CT_STATS_FLAG`
- ct_stats_flag


.. _mtd_wrapper:
Expand Down
5 changes: 4 additions & 1 deletion internal_tests/pytests/mode/test_mode_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ def set_minimum_config_settings(config):
'(0.0, 2.0) '
'200.0/grid_res, 1.0)'
');')}),
({'MODE_PS_PLOT_FLAG': 'True', },
{'METPLUS_PS_PLOT_FLAG': 'ps_plot_flag = TRUE;'}),
({'MODE_CT_STATS_FLAG': 'True', },
{'METPLUS_CT_STATS_FLAG': 'ct_stats_flag = TRUE;'}),
]
)
def test_mode_single_field(metplus_config, config_overrides,
Expand Down
9 changes: 9 additions & 0 deletions metplus/wrappers/mode_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class MODEWrapper(CompareGriddedWrapper):
'METPLUS_INTEREST_FUNCTION_CENTROID_DIST',
'METPLUS_INTEREST_FUNCTION_BOUNDARY_DIST',
'METPLUS_INTEREST_FUNCTION_CONVEX_HULL_DIST',
'METPLUS_PS_PLOT_FLAG',
'METPLUS_CT_STATS_FLAG',
]

WEIGHTS = {
Expand Down Expand Up @@ -347,6 +349,13 @@ def create_c_dict(self):
}
)

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

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


c_dict['ALLOW_MULTIPLE_FILES'] = False

c_dict['MERGE_CONFIG_FILE'] = (
Expand Down
7 changes: 5 additions & 2 deletions parm/met_config/MODEConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,15 @@ plot_gcarc_flag = FALSE;
//
// NetCDF matched pairs, PostScript, and contingency table output files
//
ps_plot_flag = TRUE;
//ps_plot_flag =
${METPLUS_PS_PLOT_FLAG}

//nc_pairs_flag = {
${METPLUS_NC_PAIRS_FLAG_DICT}

ct_stats_flag = TRUE;
//ct_stats_flag =
${METPLUS_CT_STATS_FLAG}


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

Expand Down
5 changes: 3 additions & 2 deletions parm/use_cases/met_tool_wrapper/MODE/MODE.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[config]

# MODE METplus Configuration

PROCESS_LIST = MODE

LOOP_ORDER = times
Expand Down Expand Up @@ -119,3 +117,6 @@ MODE_GRID_RES = 40
#MODE_NC_PAIRS_FLAG_POLYLINES =

MODE_QUILT = True

#MODE_PS_PLOT_FLAG =
#MODE_CT_STATS_FLAG =

0 comments on commit 3a40b14

Please sign in to comment.