From 7878e255d35b9220e2a92b5d3ec9891cbaedb31e Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 29 Jul 2021 13:39:32 -0600 Subject: [PATCH] per #951 added support for hss_ec_value --- docs/Users_Guide/glossary.rst | 20 ++++++++ docs/Users_Guide/wrappers.rst | 51 +++++++++++++++++++ .../grid_stat/test_grid_stat_wrapper.py | 2 + .../point_stat/test_point_stat_wrapper.py | 3 ++ .../series_analysis/test_series_analysis.py | 3 +- metplus/wrappers/grid_stat_wrapper.py | 5 ++ metplus/wrappers/point_stat_wrapper.py | 5 ++ metplus/wrappers/series_analysis_wrapper.py | 5 ++ metplus/wrappers/stat_analysis_wrapper.py | 5 ++ parm/met_config/GridStatConfig_wrapped | 5 +- parm/met_config/PointStatConfig_wrapped | 2 + parm/met_config/STATAnalysisConfig_wrapped | 2 + parm/met_config/SeriesAnalysisConfig_wrapped | 2 + .../met_tool_wrapper/GridStat/GridStat.conf | 1 + .../met_tool_wrapper/PointStat/PointStat.conf | 2 + .../SeriesAnalysis/SeriesAnalysis.conf | 1 + .../StatAnalysis/StatAnalysis.conf | 2 + 17 files changed, 114 insertions(+), 2 deletions(-) diff --git a/docs/Users_Guide/glossary.rst b/docs/Users_Guide/glossary.rst index 612d99e2c0..c09cb4175c 100644 --- a/docs/Users_Guide/glossary.rst +++ b/docs/Users_Guide/glossary.rst @@ -7838,3 +7838,23 @@ METplus Configuration Glossary See :term:`GFDL_TRACKER_NML_TEMPLATE_FILE`. | *Used by:* GFDLTracker + + GRID_STAT_HSS_EC_VALUE + Specify the value for 'hss_ec_value' in the MET configuration file for GridStat. + + | *Used by:* GridStat + + POINT_STAT_HSS_EC_VALUE + Specify the value for 'hss_ec_value' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + SERIES_ANALYSIS_HSS_EC_VALUE + Specify the value for 'hss_ec_value' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + STAT_ANALYSIS_HSS_EC_VALUE + Specify the value for 'hss_ec_value' in the MET configuration file for StatAnalysis. + + | *Used by:* StatAnalysis diff --git a/docs/Users_Guide/wrappers.rst b/docs/Users_Guide/wrappers.rst index 5a0f70949f..95e69bdc5c 100644 --- a/docs/Users_Guide/wrappers.rst +++ b/docs/Users_Guide/wrappers.rst @@ -2385,6 +2385,7 @@ METplus Configuration | :term:`GRID_STAT_CLIMO_STDEV_MATCH_MONTH` | :term:`GRID_STAT_CLIMO_STDEV_DAY_INTERVAL` | :term:`GRID_STAT_CLIMO_STDEV_HOUR_INTERVAL` +| :term:`GRID_STAT_HSS_EC_VALUE` | :term:`GRID_STAT_MASK_GRID` (optional) | :term:`GRID_STAT_MASK_POLY` (optional) | :term:`GRID_STAT_MET_CONFIG_OVERRIDES` @@ -2821,6 +2822,17 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`GRID_STAT_GRID_WEIGHT_FLAG` - grid_weight_flag +**${METPLUS_HSS_EC_VALUE}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`GRID_STAT_HSS_EC_VALUE` + - hss_ec_value + .. _make_plots_wrapper: @@ -4476,6 +4488,7 @@ Configuration | :term:`POINT_STAT_CLIMO_STDEV_MATCH_MONTH` | :term:`POINT_STAT_CLIMO_STDEV_DAY_INTERVAL` | :term:`POINT_STAT_CLIMO_STDEV_HOUR_INTERVAL` +| :term:`POINT_STAT_HSS_EC_VALUE` | :term:`FCST_POINT_STAT_WINDOW_BEGIN` (optional) | :term:`FCST_POINT_STAT_WINDOW_END` (optional) | :term:`OBS_POINT_STAT_WINDOW_BEGIN` (optional) @@ -4847,6 +4860,17 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`POINT_STAT_INTERP_TYPE_WIDTH` - interp.type.width +**${METPLUS_HSS_EC_VALUE}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`POINT_STAT_HSS_EC_VALUE` + - hss_ec_value + .. _py_embed_ingest_wrapper: @@ -5003,6 +5027,7 @@ METplus Configuration | :term:`SERIES_ANALYSIS_CLIMO_STDEV_MATCH_MONTH` | :term:`SERIES_ANALYSIS_CLIMO_STDEV_DAY_INTERVAL` | :term:`SERIES_ANALYSIS_CLIMO_STDEV_HOUR_INTERVAL` +| :term:`SERIES_ANALYSIS_HSS_EC_VALUE` | .. warning:: **DEPRECATED:** @@ -5271,6 +5296,18 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`SERIES_ANALYSIS_MET_CONFIG_OVERRIDES` - n/a +**${METPLUS_HSS_EC_VALUE}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`SERIES_ANALYSIS_HSS_EC_VALUE` + - hss_ec_value + + SeriesByInit ============ @@ -5351,6 +5388,7 @@ configuration file for running with LOOP_ORDER = times: | :term:`COV_THRESH_LIST` | :term:`LINE_TYPE_LIST` | :term:`STAT_ANALYSIS_SKIP_IF_OUTPUT_EXISTS` +| :term:`STAT_ANALYSIS_HSS_EC_VALUE` | The following values **must** be defined in the METplus Wrappers @@ -5387,6 +5425,7 @@ file for running with LOOP_ORDER = processes: | :term:`INTERP_PNTS_LIST` | :term:`COV_THRESH_LIST` | :term:`ALPHA_LIST` +| :term:`STAT_ANALYSIS_HSS_EC_VALUE` | .. warning:: **DEPRECATED:** @@ -5812,6 +5851,18 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`STAT_ANALYSIS_MET_CONFIG_OVERRIDES` - n/a +**${METPLUS_HSS_EC_VALUE}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`STAT_ANALYSIS_HSS_EC_VALUE` + - hss_ec_value + + .. _tc_gen_wrapper: TCGen diff --git a/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py b/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py index 6b220af88d..5ed1d7a1ce 100644 --- a/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py +++ b/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py @@ -538,6 +538,8 @@ def test_handle_climo_file_variables(metplus_config, config_overrides, {'METPLUS_FCST_FILE_TYPE': 'file_type = NETCDF_NCCF;'}), ({'OBS_GRID_STAT_FILE_TYPE': 'NETCDF_NCCF', }, {'METPLUS_OBS_FILE_TYPE': 'file_type = NETCDF_NCCF;'}), + ({'GRID_STAT_HSS_EC_VALUE': '0.5', }, + {'METPLUS_HSS_EC_VALUE': 'hss_ec_value = 0.5;'}), ] ) diff --git a/internal_tests/pytests/point_stat/test_point_stat_wrapper.py b/internal_tests/pytests/point_stat/test_point_stat_wrapper.py index d169410db0..d9672498a7 100755 --- a/internal_tests/pytests/point_stat/test_point_stat_wrapper.py +++ b/internal_tests/pytests/point_stat/test_point_stat_wrapper.py @@ -403,6 +403,9 @@ def test_met_dictionary_in_var_options(metplus_config): 'match_month = TRUE;day_interval = 30;' 'hour_interval = 12;}'), 'CLIMO_STDEV_FILE': '"/some/climo_stdev/file.txt"'}), + ({'POINT_STAT_HSS_EC_VALUE': '0.5', }, + {'METPLUS_HSS_EC_VALUE': 'hss_ec_value = 0.5;'}), + ] ) def test_point_stat_all_fields(metplus_config, config_overrides, diff --git a/internal_tests/pytests/series_analysis/test_series_analysis.py b/internal_tests/pytests/series_analysis/test_series_analysis.py index aead971ac1..1e99c93e63 100644 --- a/internal_tests/pytests/series_analysis/test_series_analysis.py +++ b/internal_tests/pytests/series_analysis/test_series_analysis.py @@ -204,7 +204,8 @@ def set_minimum_config_settings(config): 'match_month = TRUE;day_interval = 30;' 'hour_interval = 12;}'), 'CLIMO_STDEV_FILE': '"/some/climo_stdev/file.txt"'}), - + ({'SERIES_ANALYSIS_HSS_EC_VALUE': '0.5', }, + {'METPLUS_HSS_EC_VALUE': 'hss_ec_value = 0.5;'}), ] ) def test_series_analysis_single_field(metplus_config, config_overrides, diff --git a/metplus/wrappers/grid_stat_wrapper.py b/metplus/wrappers/grid_stat_wrapper.py index 33ca143376..6bf5d5c8ec 100755 --- a/metplus/wrappers/grid_stat_wrapper.py +++ b/metplus/wrappers/grid_stat_wrapper.py @@ -47,6 +47,7 @@ class GridStatWrapper(CompareGriddedWrapper): 'METPLUS_GRID_WEIGHT_FLAG', 'METPLUS_FCST_FILE_TYPE', 'METPLUS_OBS_FILE_TYPE', + 'METPLUS_HSS_EC_VALUE', ] # handle deprecated env vars used pre v4.0.0 @@ -226,6 +227,10 @@ def create_c_dict(self): extra_args={'remove_quotes': True, 'uppercase': True}) + self.add_met_config(name='hss_ec_value', + data_type='float', + metplus_configs=['GRID_STAT_HSS_EC_VALUE']) + return c_dict diff --git a/metplus/wrappers/point_stat_wrapper.py b/metplus/wrappers/point_stat_wrapper.py index 1183bdcec1..77374c5585 100755 --- a/metplus/wrappers/point_stat_wrapper.py +++ b/metplus/wrappers/point_stat_wrapper.py @@ -38,6 +38,7 @@ class PointStatWrapper(CompareGriddedWrapper): 'METPLUS_INTERP_DICT', 'METPLUS_CLIMO_MEAN_DICT', 'METPLUS_CLIMO_STDEV_DICT', + 'METPLUS_HSS_EC_VALUE', ] # handle deprecated env vars used pre v4.0.0 @@ -219,6 +220,10 @@ def create_c_dict(self): }, ) + self.add_met_config(name='hss_ec_value', + data_type='float', + metplus_configs=['POINT_STAT_HSS_EC_VALUE']) + if not c_dict['FCST_INPUT_TEMPLATE']: self.log_error('Must set FCST_POINT_STAT_INPUT_TEMPLATE ' 'in config file') diff --git a/metplus/wrappers/series_analysis_wrapper.py b/metplus/wrappers/series_analysis_wrapper.py index 0367b7ad83..555cec9e1f 100755 --- a/metplus/wrappers/series_analysis_wrapper.py +++ b/metplus/wrappers/series_analysis_wrapper.py @@ -50,6 +50,7 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper): 'METPLUS_VLD_THRESH', 'METPLUS_CTS_LIST', 'METPLUS_STAT_LIST', + 'METPLUS_HSS_EC_VALUE', ] # handle deprecated env vars used pre v4.0.0 @@ -270,6 +271,10 @@ def create_c_dict(self): # get climatology config variables self.handle_climo_dict() + self.add_met_config(name='hss_ec_value', + data_type='float', + metplus_configs=['SERIES_ANALYSIS_HSS_EC_VALUE']) + # if no forecast lead sequence is specified, # use wildcard (*) so all leads are used c_dict['WILDCARD_LEAD_IF_EMPTY'] = True diff --git a/metplus/wrappers/stat_analysis_wrapper.py b/metplus/wrappers/stat_analysis_wrapper.py index 0e6ad4f1e4..34f4e58086 100755 --- a/metplus/wrappers/stat_analysis_wrapper.py +++ b/metplus/wrappers/stat_analysis_wrapper.py @@ -61,6 +61,7 @@ class StatAnalysisWrapper(CommandBuilder): 'METPLUS_ALPHA', 'METPLUS_LINE_TYPE', 'METPLUS_JOBS', + 'METPLUS_HSS_EC_VALUE', ] field_lists = ['FCST_VAR_LIST', @@ -225,6 +226,10 @@ def create_c_dict(self): c_dict = self.set_lists_loop_or_group(c_dict) + self.add_met_config(name='hss_ec_value', + data_type='float', + metplus_configs=['STAT_ANALYSIS_HSS_EC_VALUE']) + return self.c_dict_error_check(c_dict) def c_dict_error_check(self, c_dict): diff --git a/parm/met_config/GridStatConfig_wrapped b/parm/met_config/GridStatConfig_wrapped index c09271fe71..85e95abdd4 100644 --- a/parm/met_config/GridStatConfig_wrapped +++ b/parm/met_config/GridStatConfig_wrapped @@ -43,9 +43,12 @@ cnt_logic = UNION; wind_thresh = [ NA ]; wind_logic = UNION; eclv_points = 0.05; -nc_pairs_var_suffix = ""; //nc_pairs_var_name = ${METPLUS_NC_PAIRS_VAR_NAME} +nc_pairs_var_suffix = ""; +//hss_ec_value = +${METPLUS_HSS_EC_VALUE} + rank_corr_flag = FALSE; // diff --git a/parm/met_config/PointStatConfig_wrapped b/parm/met_config/PointStatConfig_wrapped index d5dd1714aa..2a0d8d1907 100644 --- a/parm/met_config/PointStatConfig_wrapped +++ b/parm/met_config/PointStatConfig_wrapped @@ -40,6 +40,8 @@ cnt_logic = UNION; wind_thresh = [ NA ]; wind_logic = UNION; eclv_points = 0.05; +//hss_ec_value = +${METPLUS_HSS_EC_VALUE} rank_corr_flag = FALSE; // diff --git a/parm/met_config/STATAnalysisConfig_wrapped b/parm/met_config/STATAnalysisConfig_wrapped index dd0989b44d..2fac673f6c 100644 --- a/parm/met_config/STATAnalysisConfig_wrapped +++ b/parm/met_config/STATAnalysisConfig_wrapped @@ -97,6 +97,8 @@ wmo_fisher_stats = [ "CNT:PR_CORR", "CNT:SP_CORR", //////////////////////////////////////////////////////////////////////////////// +//hss_ec_value = +${METPLUS_HSS_EC_VALUE} rank_corr_flag = FALSE; vif_flag = FALSE; tmp_dir = "/tmp"; diff --git a/parm/met_config/SeriesAnalysisConfig_wrapped b/parm/met_config/SeriesAnalysisConfig_wrapped index 05763c2199..dfa6f5a4c1 100644 --- a/parm/met_config/SeriesAnalysisConfig_wrapped +++ b/parm/met_config/SeriesAnalysisConfig_wrapped @@ -119,6 +119,8 @@ output_stats = { //////////////////////////////////////////////////////////////////////////////// +//hss_ec_value = +${METPLUS_HSS_EC_VALUE} rank_corr_flag = FALSE; tmp_dir = "/tmp"; //version = "V10.0"; diff --git a/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf b/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf index a9e2e2e946..852dc69786 100644 --- a/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf +++ b/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf @@ -210,6 +210,7 @@ GRID_STAT_NC_PAIRS_FLAG_CLIMO = FALSE #GRID_STAT_NC_PAIRS_FLAG_DISTANCE_MAP = FALSE GRID_STAT_NC_PAIRS_FLAG_APPLY_MASK = FALSE +#GRID_STAT_HSS_EC_VALUE = # End of [config] section and start of [dir] section [dir] diff --git a/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf b/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf index 187fe99345..5b35b41d06 100644 --- a/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf +++ b/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf @@ -84,6 +84,8 @@ POINT_STAT_OUTPUT_FLAG_VL1L2 = STAT #POINT_STAT_CLIMO_CDF_CENTER_BINS = False #POINT_STAT_CLIMO_CDF_WRITE_BINS = True +#POINT_STAT_HSS_EC_VALUE = + # Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be # considered valid. Values are set in the 'obs_window' dictionary in the PointStat config file OBS_POINT_STAT_WINDOW_BEGIN = -5400 diff --git a/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf b/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf index 51b1b31744..8f450802a1 100644 --- a/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf +++ b/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf @@ -72,6 +72,7 @@ SERIES_ANALYSIS_REGRID_SHAPE = #SERIES_ANALYSIS_CLIMO_STDEV_DAY_INTERVAL = #SERIES_ANALYSIS_CLIMO_STDEV_HOUR_INTERVAL = +#SERIES_ANALYSIS_HSS_EC_VALUE = SERIES_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID diff --git a/parm/use_cases/met_tool_wrapper/StatAnalysis/StatAnalysis.conf b/parm/use_cases/met_tool_wrapper/StatAnalysis/StatAnalysis.conf index 41b604eb52..457dd508bc 100644 --- a/parm/use_cases/met_tool_wrapper/StatAnalysis/StatAnalysis.conf +++ b/parm/use_cases/met_tool_wrapper/StatAnalysis/StatAnalysis.conf @@ -71,6 +71,8 @@ MODEL1_OBTYPE = ANALYS # References CONFIG_DIR from the [dir] section STAT_ANALYSIS_CONFIG_FILE = {CONFIG_DIR}/STATAnalysisConfig_wrapped +#STAT_ANALYSIS_HSS_EC_VALUE = + # stat_analysis job info STAT_ANALYSIS_JOB_NAME = filter # if using -dump_row, put in JOBS_ARGS "-dump_row [dump_row_file]"