From 46658c6b2436d4200bda837184b8cbfca975699f Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:41:47 -0700 Subject: [PATCH] Feature 896 more met config (#1322) --- docs/Contributors_Guide/basic_components.rst | 8 +- docs/Users_Guide/glossary.rst | 164 +++++++++- docs/Users_Guide/wrappers.rst | 229 ++++++++++++-- .../grid_stat/test_grid_stat_wrapper.py | 16 + .../pytests/mode/test_mode_wrapper.py | 5 +- .../pytests/pb2nc/test_pb2nc_wrapper.py | 4 + .../point_stat/test_point_stat_wrapper.py | 38 +++ .../series_analysis/test_series_analysis.py | 70 ++++- .../pytests/tc_pairs/test_tc_pairs_wrapper.py | 7 + metplus/util/diff_util.py | 2 +- metplus/util/doc_util.py | 280 ++++++++++++------ metplus/util/met_config.py | 5 +- metplus/wrappers/command_builder.py | 21 +- metplus/wrappers/compare_gridded_wrapper.py | 3 +- metplus/wrappers/grid_stat_wrapper.py | 16 + metplus/wrappers/mode_wrapper.py | 9 + metplus/wrappers/pb2nc_wrapper.py | 10 + metplus/wrappers/point_stat_wrapper.py | 23 ++ metplus/wrappers/series_analysis_wrapper.py | 56 +++- metplus/wrappers/tc_pairs_wrapper.py | 10 + parm/met_config/GridStatConfig_wrapped | 12 +- parm/met_config/MODEConfig_wrapped | 7 +- parm/met_config/PB2NCConfig_wrapped | 21 +- parm/met_config/PointStatConfig_wrapped | 22 +- parm/met_config/SeriesAnalysisConfig_wrapped | 16 +- parm/met_config/TCPairsConfig_wrapped | 7 +- .../met_tool_wrapper/GridStat/GridStat.conf | 6 + .../use_cases/met_tool_wrapper/MODE/MODE.conf | 5 +- .../met_tool_wrapper/PB2NC/PB2NC.conf | 85 +----- .../met_tool_wrapper/PointStat/PointStat.conf | 191 ++++-------- .../SeriesAnalysis/SeriesAnalysis.conf | 140 +++++---- .../TCPairs/TCPairs_extra_tropical.conf | 132 +++------ .../TCPairs/TCPairs_tropical.conf | 115 +++---- 33 files changed, 1086 insertions(+), 649 deletions(-) diff --git a/docs/Contributors_Guide/basic_components.rst b/docs/Contributors_Guide/basic_components.rst index 86d3d57323..7de9af11d8 100644 --- a/docs/Contributors_Guide/basic_components.rst +++ b/docs/Contributors_Guide/basic_components.rst @@ -302,12 +302,12 @@ data type, extra info, children, and nicknames. * extra: Additional info as a comma separated string (see extra_args above) * children: Dictionary defining a nested dictionary where the key is the name of the sub-directory and the value is the item info (see items above) -* nicknames: List of METplus variable names (with app name excluded) to also +* nicknames: List of METplus variable names to also search and use if it is set. For example, the GridStat variable mask.poly is set by the METplus config variable GRID_STAT_MASK_POLY. However, in older versions of the METplus wrappers, the variable used was GRID_STAT_VERIFICATION_MASK_TEMPLATE. To preserve support for this name, the - nickname can be set to ['VERIFICATION_MASK_TEMPLATE'] and the old variable + nickname can be set to [f'{self.app_name.upper()}_VERIFICATION_MASK_TEMPLATE'] and the old variable will be checked if GRID_STAT_MASK_POLY is not set. Values must be set to None to preserve the order. @@ -320,7 +320,7 @@ CompareGriddedWrapper and is used by GridStat, PointStat, and EnsembleStat:: def handle_climo_cdf_dict(self): self.add_met_config_dict('climo_cdf', { - 'cdf_bins': ('float', None, None, ['CLIMO_CDF_BINS']), + 'cdf_bins': ('float', None, None, [f'{self.app_name.upper()}_CLIMO_CDF_BINS']), 'center_bins': 'bool', 'write_bins': 'bool', }) @@ -329,7 +329,7 @@ This function handles setting the climo_cdf dictionary. The METplus config variable that fits the format {APP_NAME}_{DICTIONARY_NAME}_{VARIABLE_NAME}, i.e. GRID_STAT_CLIMO_CDF_CDF_BINS for GridStat's climo_cdf.cdf_bins, is quieried first. However, this default name is a little redundant, so adding -the nickname 'CLIMO_CDF_BINS' allows the user to set the variable +the nickname 'GRID_STAT_CLIMO_CDF_BINS' allows the user to set the variable GRID_STAT_CLIMO_CDF_BINS instead. There are many MET config dictionaries that only contain beg and end to define diff --git a/docs/Users_Guide/glossary.rst b/docs/Users_Guide/glossary.rst index ca701205ce..5183c899be 100644 --- a/docs/Users_Guide/glossary.rst +++ b/docs/Users_Guide/glossary.rst @@ -3431,9 +3431,7 @@ METplus Configuration Glossary | *Used by:* PB2NC POINT_STAT_STATION_ID - Specify the ID of a specific station to use with the MET point_stat tool. - - | *Used by:* PointStat + .. warning:: **DEPRECATED:** Please use :term:`POINT_STAT_MASK_SID` instead. POINT_STAT_VERIFICATION_MASK_TEMPLATE Template used to specify the verification mask filename for the MET tool point_stat. Now supports a list of filenames. @@ -3734,17 +3732,13 @@ METplus Configuration Glossary .. warning:: **DEPRECATED:** Please use :term:`MAKE_PLOTS_INPUT_DIR` instead. SERIES_ANALYSIS_STAT_LIST - Specify a list of statistics to be computed by the MET series_analysis tool. Sets the 'cnt' value in the output_stats dictionary in the MET SeriesAnalysis config file - - | *Used by:* SeriesAnalysis + .. warning:: **DEPRECATED:** Please use :term:`SERIES_ANALYSIS_OUTPUT_STATS_CNT` instead. SERIES_ANALYSIS_CTS_LIST - Specify a list of contingency table statistics to be computed by the MET series_analysis tool. Sets the 'cts' value in the output_stats dictionary in the MET SeriesAnalysis config file - - | *Used by:* SeriesAnalysis + .. warning:: **DEPRECATED:** Please use :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTS` instead. STAT_LIST - .. warning:: **DEPRECATED:** Please use :term:`SERIES_ANALYSIS_STAT_LIST` instead. + .. warning:: **DEPRECATED:** Please use :term:`SERIES_ANALYSIS_OUTPUT_STATS_CNT` instead. STORM_ID .. warning:: **DEPRECATED:** Please use :term:`TC_PAIRS_STORM_ID` or :term:`TC_STAT_STORM_ID`. @@ -6066,6 +6060,11 @@ METplus Configuration Glossary | *Used by:* PointStat + POINT_STAT_MASK_LLPNT + Specify the value for 'mask.llpnt' in the MET configuration file for PointStat. + + | *Used by:* PointStat + MODE_GRID_RES Set the grid_res entry in the MODE MET config file. @@ -8530,6 +8529,151 @@ METplus Configuration Glossary | *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 + + PB2NC_OBS_BUFR_MAP + Specify the value for 'obs_bufr_map' in the MET configuration file for PB2NC. + + | *Used by:* PB2NC + + PB2NC_OBS_PREPBUFR_MAP + Specify the value for 'obs_prepbufr_map' in the MET configuration file for PB2NC. + + | *Used by:* PB2NC + + POINT_STAT_HIRA_FLAG + Specify the value for 'hira.flag' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_HIRA_WIDTH + Specify the value for 'hira.width' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_HIRA_VLD_THRESH + Specify the value for 'hira.vld_thresh' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_HIRA_COV_THRESH + Specify the value for 'hira.cov_thresh' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_HIRA_SHAPE + Specify the value for 'hira.shape' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_HIRA_PROB_CAT_THRESH + Specify the value for 'hira.prob_cat_thresh' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + POINT_STAT_MESSAGE_TYPE_GROUP_MAP + Specify the value for 'message_type_group_map' in the MET configuration file for PointStat. + + | *Used by:* PointStat + + TC_PAIRS_CHECK_DUP + Specify the value for 'check_dup' in the MET configuration file for TCPairs. + + | *Used by:* TCPairs + + TC_PAIRS_INTERP12 + Specify the value for 'interp12' in the MET configuration file for TCPairs. + + | *Used by:* TCPairs + + SERIES_ANALYSIS_OUTPUT_STATS_FHO + Specify the value for 'output_stats.fho' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_CTC + Specify the value for 'output_stats.ctc' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_CTS + Specify the value for 'output_stats.cts' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_MCTC + Specify the value for 'output_stats.mctc' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_MCTS + Specify the value for 'output_stats.mcts' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_CNT + Specify the value for 'output_stats.cnt' in the MET configuration file for SeriesAnalysis. Also used to generate plots for each value in the list. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_SL1L2 + Specify the value for 'output_stats.sl1l2' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2 + Specify the value for 'output_stats.sal1l2' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_PCT + Specify the value for 'output_stats.pct' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_PSTD + Specify the value for 'output_stats.pstd' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_PJC + Specify the value for 'output_stats.pjc' in the MET configuration file for SeriesAnalysis. + + | *Used by:* SeriesAnalysis + + SERIES_ANALYSIS_OUTPUT_STATS_PRC + 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 + + GRID_STAT_CENSOR_THRESH + Specify the value for 'censor_thresh' in the MET configuration file for GridStat. + + | *Used by:* GridStat + + GRID_STAT_CENSOR_VAL + Specify the value for 'censor_val' in the MET configuration file for GridStat. + + | *Used by:* GridStat + INIT_LIST List of initialization times to process. This variable is used when intervals between run times are irregular. diff --git a/docs/Users_Guide/wrappers.rst b/docs/Users_Guide/wrappers.rst index 40df66983e..9cd7af499e 100644 --- a/docs/Users_Guide/wrappers.rst +++ b/docs/Users_Guide/wrappers.rst @@ -2800,6 +2800,10 @@ 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_CENSOR_THRESH` +| :term:`GRID_STAT_CENSOR_VAL` | :term:`GRID_STAT_MASK_GRID` (optional) | :term:`GRID_STAT_MASK_POLY` (optional) | :term:`GRID_STAT_MET_CONFIG_OVERRIDES` @@ -3266,6 +3270,42 @@ see :ref:`How METplus controls MET config file settings`. * - :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 + +**${METPLUS_CENSOR_THRESH}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`GRID_STAT_CENSOR_THRESH` + - censor_thresh + +**${METPLUS_CENSOR_VAL}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`GRID_STAT_CENSOR_VAL` + - censor_val + + .. _ioda2nc_wrapper: IODA2NC @@ -3926,6 +3966,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_NAME` (optional) | :term:`FCST_MODE_VAR_LEVELS` (optional) | :term:`FCST_MODE_VAR_THRESH` (optional) @@ -4440,7 +4482,27 @@ see :ref:`How METplus controls MET config file settings`. * - :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: @@ -4750,6 +4812,8 @@ METplus Configuration | :term:`PB2NC_LEVEL_RANGE_END` | :term:`PB2NC_LEVEL_CATEGORY` | :term:`PB2NC_QUALITY_MARK_THRESH` +| :term:`PB2NC_OBS_BUFR_MAP` +| :term:`PB2NC_OBS_PREPBUFR_MAP` .. warning:: **DEPRECATED:** @@ -4938,6 +5002,27 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`PB2NC_QUALITY_MARK_THRESH` - quality_mark_thresh +**${METPLUS_OBS_BUFR_MAP}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`PB2NC_OBS_BUFR_MAP` + - obs_bufr_map + +**${METPLUS_OBS_PREPBUFR_MAP}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`PB2NC_OBS_PREPBUFR_MAP` + - obs_prepbufr_map .. _pcp_combine_wrapper: @@ -5136,9 +5221,10 @@ Configuration | :term:`POINT_STAT_REGRID_WIDTH` | :term:`POINT_STAT_REGRID_VLD_THRESH` | :term:`POINT_STAT_REGRID_SHAPE` -| :term:`POINT_STAT_GRID` -| :term:`POINT_STAT_POLY` -| :term:`POINT_STAT_STATION_ID` +| :term:`POINT_STAT_MASK_GRID` +| :term:`POINT_STAT_MASK_POLY` +| :term:`POINT_STAT_MASK_SID` +| :term:`POINT_STAT_MASK_LLPNT` | :term:`POINT_STAT_MESSAGE_TYPE` | :term:`POINT_STAT_CUSTOM_LOOP_LIST` | :term:`POINT_STAT_SKIP_IF_OUTPUT_EXISTS` @@ -5194,6 +5280,13 @@ Configuration | :term:`POINT_STAT_CLIMO_STDEV_DAY_INTERVAL` | :term:`POINT_STAT_CLIMO_STDEV_HOUR_INTERVAL` | :term:`POINT_STAT_HSS_EC_VALUE` +| :term:`POINT_STAT_HIRA_FLAG` +| :term:`POINT_STAT_HIRA_WIDTH` +| :term:`POINT_STAT_HIRA_VLD_THRESH` +| :term:`POINT_STAT_HIRA_COV_THRESH` +| :term:`POINT_STAT_HIRA_SHAPE` +| :term:`POINT_STAT_HIRA_PROB_CAT_THRESH` +| :term:`POINT_STAT_MESSAGE_TYPE_GROUP_MAP` | :term:`FCST_POINT_STAT_WINDOW_BEGIN` (optional) | :term:`FCST_POINT_STAT_WINDOW_END` (optional) | :term:`OBS_POINT_STAT_WINDOW_BEGIN` (optional) @@ -5453,6 +5546,18 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`POINT_STAT_MASK_SID` - mask.sid +**${METPLUS_MASK_LLPNT}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`POINT_STAT_MASK_LLPNT` + - mask.llpnt + + **${METPLUS_OUTPUT_PREFIX}** .. list-table:: @@ -5589,6 +5694,37 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`POINT_STAT_HSS_EC_VALUE` - hss_ec_value +**${METPLUS_HIRA_DICT}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`POINT_STAT_HIRA_FLAG` + - hira.flag + * - :term:`POINT_STAT_HIRA_WIDTH` + - hira.width + * - :term:`POINT_STAT_HIRA_VLD_THRESH` + - hira.vld_thresh + * - :term:`POINT_STAT_HIRA_COV_THRESH` + - hira.cov_thresh + * - :term:`POINT_STAT_HIRA_SHAPE` + - hira.shape + * - :term:`POINT_STAT_HIRA_PROB_CAT_THRESH` + - hira.prob_cat_thresh + +**${METPLUS_MESSAGE_TYPE_GROUP_MAP}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`POINT_STAT_MESSAGE_TYPE_GROUP_MAP` + - message_type_group_map .. _py_embed_ingest_wrapper: @@ -5746,6 +5882,18 @@ METplus Configuration | :term:`SERIES_ANALYSIS_CLIMO_STDEV_DAY_INTERVAL` | :term:`SERIES_ANALYSIS_CLIMO_STDEV_HOUR_INTERVAL` | :term:`SERIES_ANALYSIS_HSS_EC_VALUE` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_FHO` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTC` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTS` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_MCTC` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_MCTS` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_CNT` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_SL1L2` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PCT` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PSTD` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PJC` +| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC` | .. warning:: **DEPRECATED:** @@ -5981,18 +6129,7 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`SERIES_ANALYSIS_VLD_THRESH` - vld_thresh -**${METPLUS_CTS_LIST}** - -.. list-table:: - :widths: 5 5 - :header-rows: 0 - - * - METplus Config(s) - - MET Config File - * - :term:`SERIES_ANALYSIS_CTS_LIST` - - output_stats.cts - -**${METPLUS_STAT_LIST}** +**${METPLUS_MET_CONFIG_OVERRIDES}** .. list-table:: :widths: 5 5 @@ -6000,10 +6137,10 @@ see :ref:`How METplus controls MET config file settings`. * - METplus Config(s) - MET Config File - * - :term:`SERIES_ANALYSIS_STAT_LIST` - - output_stats.cnt + * - :term:`SERIES_ANALYSIS_MET_CONFIG_OVERRIDES` + - n/a -**${METPLUS_MET_CONFIG_OVERRIDES}** +**${METPLUS_HSS_EC_VALUE}** .. list-table:: :widths: 5 5 @@ -6011,10 +6148,10 @@ see :ref:`How METplus controls MET config file settings`. * - METplus Config(s) - MET Config File - * - :term:`SERIES_ANALYSIS_MET_CONFIG_OVERRIDES` - - n/a + * - :term:`SERIES_ANALYSIS_HSS_EC_VALUE` + - hss_ec_value -**${METPLUS_HSS_EC_VALUE}** +**${METPLUS_OUTPUT_STATS_DICT}** .. list-table:: :widths: 5 5 @@ -6022,8 +6159,30 @@ see :ref:`How METplus controls MET config file settings`. * - METplus Config(s) - MET Config File - * - :term:`SERIES_ANALYSIS_HSS_EC_VALUE` - - hss_ec_value + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_FHO` + - output_stats.fho + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTC` + - output_stats.ctc + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_CTS` + - output_stats.cts + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_MCTC` + - output_stats.mctc + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_MCTS` + - output_stats.mcts + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_CNT` + - output_stats.cnt + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_SL1L2` + - output_stats.sl1l2 + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2` + - output_stats.sal1l2 + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PCT` + - output_stats.pct + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PSTD` + - output_stats.pstd + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PJC` + - output_stats.pjc + * - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC` + - output_stats.prc SeriesByInit @@ -7329,6 +7488,8 @@ METplus Configuration | :term:`TC_PAIRS_CONSENSUS_MIN_REQ` | :term:`TC_PAIRS_SKIP_LEAD_SEQ` | :term:`TC_PAIRS_RUN_ONCE` +| :term:`TC_PAIRS_CHECK_DUP` +| :term:`TC_PAIRS_INTERP12` | .. warning:: **DEPRECATED:** @@ -7578,6 +7739,28 @@ see :ref:`How METplus controls MET config file settings`. * - :term:`TC_PAIRS_CONSENSUS_MIN_REQ` - consensus.min_req +**${METPLUS_CHECK_DUP}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`TC_PAIRS_CHECK_DUP` + - check_dup + +**${METPLUS_INTERP12}** + +.. list-table:: + :widths: 5 5 + :header-rows: 0 + + * - METplus Config(s) + - MET Config File + * - :term:`TC_PAIRS_INTERP12` + - interp12 + .. _tcrmw_wrapper: TCRMW 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 b38bee453a..80c7393c83 100644 --- a/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py +++ b/internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py @@ -567,6 +567,21 @@ 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];}')}), + ({'GRID_STAT_CENSOR_THRESH': '>12000,<5000', }, + {'METPLUS_CENSOR_THRESH': 'censor_thresh = [>12000, <5000];'}), + + ({'GRID_STAT_CENSOR_VAL': '12000, 5000', }, + {'METPLUS_CENSOR_VAL': 'censor_val = [12000, 5000];'}), ] ) @@ -616,6 +631,7 @@ def test_grid_stat_single_field(metplus_config, config_overrides, item.startswith(env_var_key)), None) assert(match is not None) actual_value = match.split('=', 1)[1] + print(f"ENV VAR: {env_var_key}") if env_var_key == 'METPLUS_FCST_FIELD': assert(actual_value == fcst_fmt) elif env_var_key == 'METPLUS_OBS_FIELD': diff --git a/internal_tests/pytests/mode/test_mode_wrapper.py b/internal_tests/pytests/mode/test_mode_wrapper.py index 8c4144fd68..4ee11d41ee 100644 --- a/internal_tests/pytests/mode/test_mode_wrapper.py +++ b/internal_tests/pytests/mode/test_mode_wrapper.py @@ -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, diff --git a/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py b/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py index a1c202c335..97b920b957 100644 --- a/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py +++ b/internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py @@ -279,6 +279,10 @@ def test_find_input_files(metplus_config, offsets, offset_to_find): 'type = ["min", "max", "range"];' 'vld_freq = 1;' 'vld_thresh = 0.1;}')}), + ({'PB2NC_OBS_BUFR_MAP': '{key="POB"; val="PRES"; },{key="QOB"; val="SPFH";}', }, + {'METPLUS_OBS_BUFR_MAP': 'obs_bufr_map = [{key="POB"; val="PRES"; }, {key="QOB"; val="SPFH";}];'}), + ({'PB2NC_OBS_PREPBUFR_MAP': '{key="POB"; val="PRES"; },{key="QOB"; val="SPFH";}', }, + {'METPLUS_OBS_PREPBUFR_MAP': 'obs_prepbufr_map = [{key="POB"; val="PRES"; }, {key="QOB"; val="SPFH";}];'}), ] ) 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 f706e702d1..118a6f7dcc 100755 --- a/internal_tests/pytests/point_stat/test_point_stat_wrapper.py +++ b/internal_tests/pytests/point_stat/test_point_stat_wrapper.py @@ -405,6 +405,44 @@ def test_met_dictionary_in_var_options(metplus_config): 'CLIMO_STDEV_FILE': '"/some/climo_stdev/file.txt"'}), ({'POINT_STAT_HSS_EC_VALUE': '0.5', }, {'METPLUS_HSS_EC_VALUE': 'hss_ec_value = 0.5;'}), + ({'POINT_STAT_MASK_LLPNT': ('{ name = "LAT30TO40"; lat_thresh = >=30&&<=40; lon_thresh = NA; },' + '{ name = "BOX"; lat_thresh = >=20&&<=40; lon_thresh = >=-110&&<=-90; }')}, + {'METPLUS_MASK_LLPNT': 'llpnt = [{ name = "LAT30TO40"; lat_thresh = >=30&&<=40; lon_thresh = NA; }, { name = "BOX"; lat_thresh = >=20&&<=40; lon_thresh = >=-110&&<=-90; }];'}), + + ({'POINT_STAT_HIRA_FLAG': 'False', }, + {'METPLUS_HIRA_DICT': 'hira = {flag = FALSE;}'}), + + ({'POINT_STAT_HIRA_WIDTH': '2,3,4,5', }, + {'METPLUS_HIRA_DICT': 'hira = {width = [2, 3, 4, 5];}'}), + + ({'POINT_STAT_HIRA_VLD_THRESH': '1.0', }, + {'METPLUS_HIRA_DICT': 'hira = {vld_thresh = 1.0;}'}), + + ({'POINT_STAT_HIRA_COV_THRESH': '==0.25, ==0.5', }, + {'METPLUS_HIRA_DICT': 'hira = {cov_thresh = [==0.25, ==0.5];}'}), + + ({'POINT_STAT_HIRA_SHAPE': 'square', }, + {'METPLUS_HIRA_DICT': 'hira = {shape = SQUARE;}'}), + + ({'POINT_STAT_HIRA_PROB_CAT_THRESH': '>1,<=2', }, + {'METPLUS_HIRA_DICT': 'hira = {prob_cat_thresh = [>1, <=2];}'}), + + ({ + 'POINT_STAT_HIRA_FLAG': 'False', + 'POINT_STAT_HIRA_WIDTH': '2,3,4,5', + 'POINT_STAT_HIRA_VLD_THRESH': '1.0', + 'POINT_STAT_HIRA_COV_THRESH': '==0.25, ==0.5', + 'POINT_STAT_HIRA_SHAPE': 'square', + 'POINT_STAT_HIRA_PROB_CAT_THRESH': '>1,<=2', + }, + { + 'METPLUS_HIRA_DICT': ('hira = {flag = FALSE;width = [2, 3, 4, 5];' + 'vld_thresh = 1.0;' + 'cov_thresh = [==0.25, ==0.5];' + 'shape = SQUARE;' + 'prob_cat_thresh = [>1, <=2];}')}), + ({'POINT_STAT_MESSAGE_TYPE_GROUP_MAP': '{ key = "SURFACE"; val = "ADPSFC,SFCSHP,MSONET";},{ key = "ANYAIR"; val = "AIRCAR,AIRCFT";}', }, + {'METPLUS_MESSAGE_TYPE_GROUP_MAP': 'message_type_group_map = [{ key = "SURFACE"; val = "ADPSFC, SFCSHP, MSONET";}, { key = "ANYAIR"; val = "AIRCAR, AIRCFT";}];'}), ] ) diff --git a/internal_tests/pytests/series_analysis/test_series_analysis.py b/internal_tests/pytests/series_analysis/test_series_analysis.py index 1e99c93e63..5d21eb0b39 100644 --- a/internal_tests/pytests/series_analysis/test_series_analysis.py +++ b/internal_tests/pytests/series_analysis/test_series_analysis.py @@ -25,7 +25,7 @@ run_times = ['2005080700',] stat_list = 'TOTAL,RMSE,FBAR,OBAR' stat_list_quotes = '", "'.join(stat_list.split(',')) -stat_list_fmt = f'cnt = ["{stat_list_quotes}"];' +stat_list_fmt = f'output_stats = {{cnt = ["{stat_list_quotes}"];}}' def get_input_dirs(config): fake_data_dir = os.path.join(config.getdir('METPLUS_BASE'), @@ -206,6 +206,71 @@ def set_minimum_config_settings(config): 'CLIMO_STDEV_FILE': '"/some/climo_stdev/file.txt"'}), ({'SERIES_ANALYSIS_HSS_EC_VALUE': '0.5', }, {'METPLUS_HSS_EC_VALUE': 'hss_ec_value = 0.5;'}), + # output_stats + ({'SERIES_ANALYSIS_OUTPUT_STATS_FHO': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {fho = ["RMSE", "FBAR", "OBAR"];cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_CTC': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {ctc = ["RMSE", "FBAR", "OBAR"];cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_CTS': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cts = ["RMSE", "FBAR", "OBAR"];cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_MCTC': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {mctc = ["RMSE", "FBAR", "OBAR"];cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_MCTS': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {mcts = ["RMSE", "FBAR", "OBAR"];cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_CNT': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_SL1L2': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];sl1l2 = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];sal1l2 = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_PCT': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];pct = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_PSTD': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];pstd = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_PJC': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];pjc = ["RMSE", "FBAR", "OBAR"];}'}), + + ({'SERIES_ANALYSIS_OUTPUT_STATS_PRC': 'RMSE,FBAR,OBAR', }, + {'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];prc = ["RMSE", "FBAR", "OBAR"];}'}), + + ({ + 'SERIES_ANALYSIS_OUTPUT_STATS_FHO': 'RMSE1,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_CTC': 'RMSE2,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_CTS': 'RMSE3,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_MCTC': 'RMSE4,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_MCTS': 'RMSE5,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_CNT': 'RMSE6,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_SL1L2': 'RMSE7,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2': 'RMSE8,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_PCT': 'RMSE9,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_PSTD': 'RMSE10,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_PJC': 'RMSE11,FBAR,OBAR', + 'SERIES_ANALYSIS_OUTPUT_STATS_PRC': 'RMSE12,FBAR,OBAR', + }, + {'METPLUS_OUTPUT_STATS_DICT': ('output_stats = {' + 'fho = ["RMSE1", "FBAR", "OBAR"];' + 'ctc = ["RMSE2", "FBAR", "OBAR"];' + 'cts = ["RMSE3", "FBAR", "OBAR"];' + 'mctc = ["RMSE4", "FBAR", "OBAR"];' + 'mcts = ["RMSE5", "FBAR", "OBAR"];' + 'cnt = ["RMSE6", "FBAR", "OBAR"];' + 'sl1l2 = ["RMSE7", "FBAR", "OBAR"];' + 'sal1l2 = ["RMSE8", "FBAR", "OBAR"];' + 'pct = ["RMSE9", "FBAR", "OBAR"];' + 'pstd = ["RMSE10", "FBAR", "OBAR"];' + 'pjc = ["RMSE11", "FBAR", "OBAR"];' + 'prc = ["RMSE12", "FBAR", "OBAR"];}')}), + ] ) def test_series_analysis_single_field(metplus_config, config_overrides, @@ -248,11 +313,12 @@ def test_series_analysis_single_field(metplus_config, config_overrides, item.startswith(env_var_key)), None) assert(match is not None) actual_value = match.split('=', 1)[1] + print(f"ENV VAR: {env_var_key}") if env_var_key == 'METPLUS_FCST_FIELD': assert(actual_value == fcst_fmt) elif env_var_key == 'METPLUS_OBS_FIELD': assert (actual_value == obs_fmt) - elif env_var_key == 'METPLUS_STAT_LIST': + elif env_var_key == 'METPLUS_OUTPUT_STATS_DICT' and 'METPLUS_OUTPUT_STATS_DICT' not in env_var_values: assert (actual_value == stat_list_fmt) else: assert(env_var_values.get(env_var_key, '') == actual_value) diff --git a/internal_tests/pytests/tc_pairs/test_tc_pairs_wrapper.py b/internal_tests/pytests/tc_pairs/test_tc_pairs_wrapper.py index 5696553914..a0845be227 100644 --- a/internal_tests/pytests/tc_pairs/test_tc_pairs_wrapper.py +++ b/internal_tests/pytests/tc_pairs/test_tc_pairs_wrapper.py @@ -361,6 +361,13 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides, # 17: write_valid ({'TC_PAIRS_WRITE_VALID': '20141031_14'}, {'METPLUS_WRITE_VALID': 'write_valid = ["20141031_14"];'}), + # 18: check_dup + ({'TC_PAIRS_CHECK_DUP': 'False', }, + {'METPLUS_CHECK_DUP': 'check_dup = FALSE;'}), + # 19: interp12 + ({'TC_PAIRS_INTERP12': 'replace', }, + {'METPLUS_INTERP12': 'interp12 = REPLACE;'}), + ] ) def test_tc_pairs_loop_order_processes(metplus_config, config_overrides, diff --git a/metplus/util/diff_util.py b/metplus/util/diff_util.py index e894bbda04..8c59539052 100644 --- a/metplus/util/diff_util.py +++ b/metplus/util/diff_util.py @@ -445,7 +445,7 @@ def nc_is_equal(file_a, file_b, fields=None, debug=False): if any(var_a[:].flatten() != var_b[:].flatten()): print(f"ERROR: Field ({field}) values (non-numeric) " "differ\n" - f" File_A: {var_a}\n File_B: {var_b}") + f" File_A: {var_a[:]}\n File_B: {var_b[:]}") is_equal = False except: print("ERROR: Couldn't diff NetCDF files, need to update diff method") diff --git a/metplus/util/doc_util.py b/metplus/util/doc_util.py index 5bf834d86f..9338a69369 100755 --- a/metplus/util/doc_util.py +++ b/metplus/util/doc_util.py @@ -60,7 +60,7 @@ def get_wrapper_name(process_name): return None -def print_doc_text(tool_name, met_var, dict_items): +def print_doc_text(tool_name, input_dict): """! Format documentation for adding support for a new MET config variable through METplus wrappers. @@ -70,91 +70,181 @@ def print_doc_text(tool_name, met_var, dict_items): is a dictionary """ wrapper_caps = tool_name.upper() - met_var_caps = met_var.upper() - env_var_name = f'METPLUS_{met_var_caps}' - wrapper_camel = get_wrapper_name(wrapper_caps) - metplus_var = f'{wrapper_caps}_{met_var_caps}' - - metplus_config_names = [] - met_config_values = [] - if not dict_items: - metplus_config_names.append(metplus_var) - met_config_values.append(met_var) - else: - env_var_name = f'{env_var_name}_DICT' - for item_name in dict_items: - item_name_caps = item_name.upper() - metplus_config_name = f'{metplus_var}_{item_name_caps}' - - metplus_config_names.append(metplus_config_name) - met_config_values.append(f"{met_var}.{item_name}") - - print('WARNING: Guidance output from this script may differ slightly ' + # get info for each variable and store it in a dictionary + met_vars = [] + for var_name, dict_list in input_dict.items(): + metplus_var = f'{wrapper_caps}_{var_name.upper()}' + env_var_name = f'METPLUS_{var_name.upper()}' + met_var = {'name': var_name, 'dict_items': dict_list, + 'metplus_config_names': [], 'met_config_names': []} + if not dict_list: + met_var['env_var_name'] = env_var_name + met_var['metplus_config_names'].append(metplus_var) + met_var['met_config_names'].append(var_name) + else: + met_var['env_var_name'] = f'{env_var_name}_DICT' + for item_name in dict_list: + metplus_config = f'{metplus_var}_{item_name.upper()}' + met_config = f"{var_name}.{item_name}" + met_var['metplus_config_names'].append(metplus_config) + met_var['met_config_names'].append(met_config) + + met_vars.append(met_var) + + print(f"\nWrapper: {wrapper_camel}\n") + for index, var in enumerate(met_vars, 1): + print(f"MET Variable {index}: {var['name']}") + if var['dict_items']: + print(f" Dictionary Items: {', '.join(var['dict_items'])}") + print() + + print('\nWARNING: Guidance output from this script may differ slightly ' 'from the actual steps to take. It is intended to assist the process.' ' The text that is generated should be reviewed for accuracy before ' 'adding to codebase.') - print(f"\nWrapper: {wrapper_camel}") - print(f"MET Variable: {met_var}") - if dict_items: - print(f"Dictionary Items:") - for item in dict_items: - print(f' {item}') - + print("\nNOTE: Text between lines that contain all dashes (-) should be " + "added or replaced in the files. Do not include the dash lines.") print('\n==================================================\n') - print(f'\n\nIn the {tool_name}_wrapper.py file, in the {wrapper_camel}Wrapper ' + print(f'In metplus/wrappers/{tool_name}_wrapper.py\n\n' + f'In the {wrapper_camel}Wrapper ' f'class, add the following to the WRAPPER_ENV_VAR_KEYS class ' - f"variable list:\n\n\n '{env_var_name}',\n\n") + f"variable list:\n" + "\n---------------------------------------------") + for var in met_vars: + print(f" '{var['env_var_name']}',") + print(f"---------------------------------------------\n") print('\n==================================================\n') + print(f'In metplus/wrappers/{tool_name}_wrapper.py\n\n') print(f'In the create_c_dict function for {wrapper_camel}Wrapper, add a ' 'function call to read the new METplus config variables and save ' - 'the value to be added to the wrapped MET config file.\n\n') - if not dict_items: - print(f" self.add_met_config(name='{met_var}',\n" - " data_type='',\n" - f" metplus_configs=['{metplus_var}'])" - "\n\n\n" - "where can be string, list, int, float, bool, " - "or thresh.\n\n") - else: - print("Typically a function is written to handle MET config dictionary" - " items. Search for functions that start with handle_ in " - "CommandBuilder or other parent class wrappers to see if a " - "function already exists for the item you are adding or to use " - "as an example to write a new one.\n\n") + 'the value to be added to the wrapped MET config file.\n') + print("\n---------------------------------------------") + for var in met_vars: + print_add_met_config(var) + print("---------------------------------------------\n" + "\nwhere DATA_TYPE can be string, list, int, float, bool, " + "or thresh. Refer to the METplus Contributor's Guide " + "Basic Components section to see how to add additional info.\n") + print("Sometimes a function is written to handle MET config dictionary" + " items that are complex and common to many wrappers." + " Search for functions that start with handle_ in " + "CommandBuilder or other parent class wrappers to see if a " + "function already exists for the item you are adding or to use " + "as an example to write a new one.\n\n") print('\n==================================================\n') print('Add the new variables to the basic use case example for the tool,\n' f'i.e. parm/use_cases/met_tool_wrapper/{wrapper_camel}/' - f'{wrapper_camel}.conf:\n\n') - for mp_config in metplus_config_names: - print(f'#{mp_config} =') + f'{wrapper_camel}.conf:\n' + "\n---------------------------------------------") + for var in met_vars: + for mp_config in var['metplus_config_names']: + print(f'#{mp_config} =') + + print("---------------------------------------------\n") print('\n\n==================================================\n') - print(f"In the parm/met_config/{wrapper_camel}Config_wrapped file, " - f"compare the default values set for {met_var} to the version" + + var_names = '/'.join([var['name'] for var in met_vars]) + print(f"In parm/met_config/{wrapper_camel}Config_wrapped\n\n" + "IMPORTANT: Compare the default values set for " + f"{var_names} " + "to the version" f" in share/met/config/{wrapper_camel}Config_default. If " "they do differ, make sure to add variables to the use case " "config files so that they produce the same output.\n\n") - print(f"In the parm/met_config/{wrapper_camel}Config_wrapped file, " - "replace:\n\n") - print(f"{met_var} = ...\n\n with:\n\n//{met_var} =" - f"{' {' if dict_items else ''}\n${{{env_var_name}}}\n\n") + + for var in met_vars: + print("REPLACE:\n" + "\n---------------------------------------------") + print(f"{var['name']} = ..." + "\n---------------------------------------------\n" + "\nwith:\n" + "\n---------------------------------------------\n" + f"//{var['name']} =" + f"{' {' if var['dict_items'] else ''}\n${{{var['env_var_name']}}}" + "\n---------------------------------------------\n") print('\n==================================================\n') - print(f"\n\nIn docs/Users_Guide/wrappers.rst under {wrapper_camel} => " - "METplus Configuration section, add:\n\n") - for metplus_config_name in metplus_config_names: - print(f'| :term:`{metplus_config_name}`') + print(f"\nIn docs/Users_Guide/wrappers.rst\n\n" + f"Under {wrapper_camel} => " + "METplus Configuration section, add:\n" + "\n---------------------------------------------") + for var in met_vars: + for metplus_config_name in var['metplus_config_names']: + print(f'| :term:`{metplus_config_name}`') + + print("---------------------------------------------\n") print('\n==================================================\n') - print(f"\n\nIn docs/Users_Guide/wrappers.rst under {wrapper_camel} => " - "MET Configuration section, add:\n\n") - var_header = (f"**${{{env_var_name}}}**") + print(f"\n\nIn docs/Users_Guide/wrappers.rst\n\n" + f"Under {wrapper_camel} => " + "MET Configuration section, add:\n" + "\n---------------------------------------------\n") + + for var in met_vars: + print_met_config_table(var) + + print("---------------------------------------------") + print('\n==================================================\n') + print(f"In docs/Users_Guide/glossary.rst" + "\n\nAdd the following anywhere in the file:\n") + print("---------------------------------------------\n") + + for var in met_vars: + print_glossary_entry(var, wrapper_camel) + + print("---------------------------------------------") + print('\n==================================================\n') + print(f"In internal_tests/pytests/{tool_name}/" + f"test_{tool_name}_wrapper.py" + "\n\nAdd the following items to " + "the tests to ensure the new items are set properly. Note: " + "if the tool does not have unit tests to check the handling of " + "MET config variables, you will need to add those tests. See " + "grid_stat/test_grid_stat_wrapper.py for an example. Change " + "VALUE to an appropriate value for the variable.\n\n") + + print("---------------------------------------------") + for var in met_vars: + print_unit_test(var) + print("---------------------------------------------") + # add note to test setting a valid value in the basic use case config file + # to ensure that it is formatted properly when read by the MET tool + print('\n==================================================\n') + print(f"In parm/use_cases/met_tool_wrapper/{wrapper_camel}" + "\n\nVerify that the new METplus configuration variable(s) " + "will be formatted properly when read by the MET tool by " + "setting the variable(s) in the basic use case config files " + "to a valid value " + "and run the use case to ensure that it still succeeds. " + "Be sure to remove the value and comment out the variable " + "after you have confirmed this step.") + print('\n==================================================\n') + +def print_add_met_config(var): + met_var = var['name'] + dict_items = var['dict_items'] + if not dict_items: + print(f" self.add_met_config(name='{met_var}',\n" + " data_type='DATA_TYPE')") + else: + print(f" self.add_met_config_dict('{met_var}', {{") + for item in dict_items: + print(f" '{item}': 'DATA_TYPE',") + print(" })") + print() + +def print_met_config_table(var): + env_var_name = var['env_var_name'] + metplus_names = var['metplus_config_names'] + met_names = var['met_config_names'] + var_header = (f"**${{{env_var_name}}}**") list_table_text = (f"{var_header}\n\n" ".. list-table::\n" " :widths: 5 5\n" @@ -163,33 +253,33 @@ def print_doc_text(tool_name, met_var, dict_items): " - MET Config File\n" ) - for metplus_config_name, met_config_name in zip(metplus_config_names, met_config_values): + for metplus_config_name, met_config_name in zip(metplus_names, met_names): list_table_text += (f" * - :term:`{metplus_config_name}`\n" f" - {met_config_name}\n" ) print(list_table_text) - print('\n==================================================\n') - print(f"In docs/Users_Guide/glossary.rst, add:\n\n") - for metplus_config_name, met_config_name in zip(metplus_config_names, met_config_values): - glossary_entry = (f" {metplus_config_name}\n" - f" Specify the value for '{met_config_name}' " - f"in the MET configuration file for {wrapper_camel}.\n\n" - f" | *Used by:* {wrapper_camel}") +def print_glossary_entry(var, wrapper_camel): + metplus_names = var['metplus_config_names'] + met_names = var['met_config_names'] + for metplus_config_name, met_config_name in zip(metplus_names, met_names): + glossary_entry = ( + f" {metplus_config_name}\n" + f" Specify the value for '{met_config_name}' " + f"in the MET configuration file for {wrapper_camel}.\n\n" + f" | *Used by:* {wrapper_camel}" + ) print(f'{glossary_entry}\n') - print('\n==================================================\n') - print(f"In internal_tests/pytests/{tool_name}/" - f"test_{tool_name}_wrapper.py, add the following items to " - "the tests to ensure the new items are set properly. Note: " - "if the tool does not have unit tests to check the handling of " - "MET config variables, you will need to add those tests. See " - "grid_stat/test_grid_stat_wrapper.py for an example. Change " - "VALUE to an appropriate value for the variable.\n\n") - +def print_unit_test(var): input_dict_items = [] output_items = [] - for metplus_config_name, met_config_name in zip(metplus_config_names, met_config_values): + metplus_names = var['metplus_config_names'] + met_names = var['met_config_names'] + dict_items = var['dict_items'] + env_var_name = var['env_var_name'] + var_name = var['name'] + for metplus_config_name, met_config_name in zip(metplus_names, met_names): if dict_items: item_name = met_config_name.split('.')[1] output_item = f"{item_name} = VALUE;" @@ -203,9 +293,8 @@ def print_doc_text(tool_name, met_var, dict_items): else: output_fmt = output_item - test_text = (f" ({{{mp_config_dict_item} }},\n" - f" {{'{env_var_name}': '{met_var} = " + f" {{'{env_var_name}': '{var_name} = " f"{output_fmt}'}}),\n") print(test_text) @@ -214,7 +303,7 @@ def print_doc_text(tool_name, met_var, dict_items): for input_dict_item in input_dict_items: all_items_text += f" {input_dict_item}\n" all_items_text += (" },\n" - f" {{'{env_var_name}': '{met_var} = {{") + f" {{'{env_var_name}': '{var_name} = {{") all_items_text += ''.join(output_items) all_items_text += "}'})," print(all_items_text) @@ -222,24 +311,29 @@ def print_doc_text(tool_name, met_var, dict_items): def doc_util_usage(): """! Print usage statement for script """ - print(f"{__file__} [ " []" ' + '" []"\n' + f"\nExample: {__file__} grid_stat output_prefix " + "\n (simple variable named output_prefix)\n" + f'\nExample: {__file__} grid_stat "output_flag fho ctc mctc" ' + '\n (dictionary named output_flag containing fho, ctc, and mctc)\n' + f'\nExample: {__file__} grid_stat "output_flag fho ctc mctc" ' + 'output_prefix \n (both of the variables from the previous ' + 'examples)\n') if __name__ == "__main__": # sys.argv[1] is MET tool name, i.e. grid_stat - # sys.argv[2] is MET variable name, i.e. output_flag - # sys.argv[3] is optional list of MET dictionary var items: fho ctc cts + # sys.argv[2+] is MET variable name, i.e. output_flag or a MET variable + # name followed by a list of MET dictionary var items separated by spaces if len(sys.argv) < 3: doc_util_usage() sys.exit(1) tool_name = sys.argv[1] - met_var = sys.argv[2] - dict_items = None - - if len(sys.argv) > 3: - items = ','.join(sys.argv[3:]).split(',') - dict_items = [item.strip() for item in items] + input_dict = {} + for arg in sys.argv[2:]: + var_name, *dict_items = arg.split() + input_dict[var_name] = dict_items - print_doc_text(tool_name, met_var, dict_items) + print_doc_text(tool_name, input_dict) diff --git a/metplus/util/met_config.py b/metplus/util/met_config.py index 847eb43e21..e8ef186e94 100644 --- a/metplus/util/met_config.py +++ b/metplus/util/met_config.py @@ -173,11 +173,10 @@ def add_met_config_dict(config, app_name, output_dict, dict_name, items): metplus_configs.append(f'{metplus_name}IN') metplus_configs.append(metplus_name) + # add other variable names to search if expected name is unset if nicknames: for nickname in nicknames: - metplus_configs.append( - f'{app_name}_{nickname}'.upper() - ) + metplus_configs.append(nickname) # if dictionary, read get children from MET config else: diff --git a/metplus/wrappers/command_builder.py b/metplus/wrappers/command_builder.py index 3835d8b130..9b4ea34922 100755 --- a/metplus/wrappers/command_builder.py +++ b/metplus/wrappers/command_builder.py @@ -1685,6 +1685,7 @@ def handle_time_summary_dict(self): METPLUS_TIME_SUMMARY_DICT that is referenced in the wrapped MET config files. """ + app_upper = self.app_name.upper() self.add_met_config_dict('time_summary', { 'flag': 'bool', 'raw_data': 'bool', @@ -1693,12 +1694,15 @@ def handle_time_summary_dict(self): 'step': 'int', 'width': ('string', 'remove_quotes'), 'grib_code': ('list', 'remove_quotes,allow_empty', None, - ['TIME_SUMMARY_GRIB_CODES']), + [f'{app_upper}_TIME_SUMMARY_GRIB_CODES']), 'obs_var': ('list', 'allow_empty', None, - ['TIME_SUMMARY_VAR_NAMES']), - 'type': ('list', 'allow_empty', None, ['TIME_SUMMARY_TYPES']), - 'vld_freq': ('int', None, None, ['TIME_SUMMARY_VALID_FREQ']), - 'vld_thresh': ('float', None, None, ['TIME_SUMMARY_VALID_THRESH']), + [f'{app_upper}_TIME_SUMMARY_VAR_NAMES']), + 'type': ('list', 'allow_empty', None, + [f'{app_upper}_TIME_SUMMARY_TYPES']), + 'vld_freq': ('int', None, None, + [f'{app_upper}_TIME_SUMMARY_VALID_FREQ']), + 'vld_thresh': ('float', None, None, + [f'{app_upper}_TIME_SUMMARY_VALID_THRESH']), }) def handle_mask(self, single_value=False, get_flags=False): @@ -1709,12 +1713,13 @@ def handle_mask(self, single_value=False, get_flags=False): @param get_flags if True, read grid_flag and poly_flag values """ data_type = 'string' if single_value else 'list' - + app_upper = self.app_name.upper() items = { 'grid': (data_type, 'allow_empty', None, - ['GRID']), + [f'{app_upper}_GRID']), 'poly': (data_type, 'allow_empty', None, - ['VERIFICATION_MASK_TEMPLATE', 'POLY']), + [f'{app_upper}_VERIFICATION_MASK_TEMPLATE', + f'{app_upper}_POLY']), } if get_flags: diff --git a/metplus/wrappers/compare_gridded_wrapper.py b/metplus/wrappers/compare_gridded_wrapper.py index f90e7c0567..e9c4e2bafe 100755 --- a/metplus/wrappers/compare_gridded_wrapper.py +++ b/metplus/wrappers/compare_gridded_wrapper.py @@ -404,7 +404,8 @@ def get_command(self): def handle_climo_cdf_dict(self): self.add_met_config_dict('climo_cdf', { - 'cdf_bins': ('float', None, None, ['CLIMO_CDF_BINS']), + 'cdf_bins': ('float', None, None, + [f'{self.app_name.upper()}_CLIMO_CDF_BINS']), 'center_bins': 'bool', 'write_bins': 'bool', }) diff --git a/metplus/wrappers/grid_stat_wrapper.py b/metplus/wrappers/grid_stat_wrapper.py index 2ad1d011a2..35451c9ff2 100755 --- a/metplus/wrappers/grid_stat_wrapper.py +++ b/metplus/wrappers/grid_stat_wrapper.py @@ -49,6 +49,9 @@ class GridStatWrapper(CompareGriddedWrapper): 'METPLUS_OBS_FILE_TYPE', 'METPLUS_HSS_EC_VALUE', 'METPLUS_DISTANCE_MAP_DICT', + 'METPLUS_FOURIER_DICT', + 'METPLUS_CENSOR_THRESH', + 'METPLUS_CENSOR_VAL', ] # handle deprecated env vars used pre v4.0.0 @@ -246,6 +249,19 @@ 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'), + }) + + self.add_met_config(name='censor_thresh', + data_type='list', + extra_args={'remove_quotes': True}) + + self.add_met_config(name='censor_val', + data_type='list', + extra_args={'remove_quotes': True}) + return c_dict def set_environment_variables(self, time_info): diff --git a/metplus/wrappers/mode_wrapper.py b/metplus/wrappers/mode_wrapper.py index af4237c4d7..23f958ac10 100755 --- a/metplus/wrappers/mode_wrapper.py +++ b/metplus/wrappers/mode_wrapper.py @@ -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 = { @@ -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'] = ( diff --git a/metplus/wrappers/pb2nc_wrapper.py b/metplus/wrappers/pb2nc_wrapper.py index f571934f3c..31828f145b 100755 --- a/metplus/wrappers/pb2nc_wrapper.py +++ b/metplus/wrappers/pb2nc_wrapper.py @@ -35,6 +35,8 @@ class PB2NCWrapper(CommandBuilder): 'METPLUS_LEVEL_RANGE_DICT', 'METPLUS_LEVEL_CATEGORY', 'METPLUS_QUALITY_MARK_THRESH', + 'METPLUS_OBS_BUFR_MAP', + 'METPLUS_OBS_PREPBUFR_MAP', ] def __init__(self, config, instance=None, config_overrides=None): @@ -187,6 +189,14 @@ def create_c_dict(self): data_type='int', metplus_configs=['PB2NC_QUALITY_MARK_THRESH']) + self.add_met_config(name='obs_bufr_map', + data_type='list', + extra_args={'remove_quotes': True}) + + self.add_met_config(name='obs_prepbufr_map', + data_type='list', + extra_args={'remove_quotes': True}) + return c_dict def set_environment_variables(self, time_info): diff --git a/metplus/wrappers/point_stat_wrapper.py b/metplus/wrappers/point_stat_wrapper.py index c47673a5a4..669ab8252c 100755 --- a/metplus/wrappers/point_stat_wrapper.py +++ b/metplus/wrappers/point_stat_wrapper.py @@ -32,6 +32,7 @@ class PointStatWrapper(CompareGriddedWrapper): 'METPLUS_MASK_GRID', 'METPLUS_MASK_POLY', 'METPLUS_MASK_SID', + 'METPLUS_MASK_LLPNT', 'METPLUS_OUTPUT_PREFIX', 'METPLUS_CLIMO_CDF_DICT', 'METPLUS_OBS_QUALITY_INC', @@ -41,6 +42,8 @@ class PointStatWrapper(CompareGriddedWrapper): 'METPLUS_CLIMO_MEAN_DICT', 'METPLUS_CLIMO_STDEV_DICT', 'METPLUS_HSS_EC_VALUE', + 'METPLUS_HIRA_DICT', + 'METPLUS_MESSAGE_TYPE_GROUP_MAP', ] # handle deprecated env vars used pre v4.0.0 @@ -165,6 +168,13 @@ def create_c_dict(self): 'POINT_STAT_STATION_ID'], extra_args={'allow_empty': True}) + self.add_met_config(name='llpnt', + data_type='list', + env_var_name='METPLUS_MASK_LLPNT', + metplus_configs=['POINT_STAT_MASK_LLPNT'], + extra_args={'allow_empty': True, + 'remove_quotes': True}) + self.add_met_config(name='message_type', data_type='list') @@ -231,6 +241,19 @@ def create_c_dict(self): data_type='float', metplus_configs=['POINT_STAT_HSS_EC_VALUE']) + self.add_met_config_dict('hira', { + 'flag': 'bool', + 'width': ('list', 'remove_quotes'), + 'vld_thresh': 'float', + 'cov_thresh': ('list', 'remove_quotes'), + 'shape': ('string', 'remove_quotes, uppercase'), + 'prob_cat_thresh': ('list', 'remove_quotes'), + }) + + self.add_met_config(name='message_type_group_map', + data_type='list', + extra_args={'remove_quotes': True}) + 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 8a16f4e2dd..8fdd625079 100755 --- a/metplus/wrappers/series_analysis_wrapper.py +++ b/metplus/wrappers/series_analysis_wrapper.py @@ -51,8 +51,7 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper): 'METPLUS_CLIMO_STDEV_DICT', 'METPLUS_BLOCK_SIZE', 'METPLUS_VLD_THRESH', - 'METPLUS_CTS_LIST', - 'METPLUS_STAT_LIST', + 'METPLUS_OUTPUT_STATS_DICT', 'METPLUS_HSS_EC_VALUE', ] @@ -60,6 +59,24 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper): DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ 'CLIMO_MEAN_FILE', 'CLIMO_STDEV_FILE', + 'METPLUS_CTS_LIST', + 'METPLUS_STAT_LIST', + ] + + # variable names of output_stats dictionary + OUTPUT_STATS = [ + 'fho', + 'ctc', + 'cts', + 'mctc', + 'mcts', + 'cnt', + 'sl1l2', + 'sal1l2', + 'pct', + 'pstd', + 'pjc', + 'prc', ] def __init__(self, config, instance=None, config_overrides=None): @@ -118,23 +135,42 @@ def create_c_dict(self): data_type='string', extra_args={'remove_quotes': True}) - # get stat list to loop over - c_dict['STAT_LIST'] = getlist( - self.config.getstr('config', - 'SERIES_ANALYSIS_STAT_LIST', - '') - ) + # handle all output_stats dictionary values + output_stats_dict = {} + for key in self.OUTPUT_STATS: + nicknames = [ + f'SERIES_ANALYSIS_OUTPUT_STATS_{key.upper()}', + f'SERIES_ANALYSIS_{key.upper()}_LIST', + f'SERIES_ANALYSIS_{key.upper()}' + ] + # add legacy support for STAT_LIST for cnt + if key == 'cnt': + nicknames.append('SERIES_ANALYSIS_STAT_LIST') + # read cnt stat list to get stats to loop over for plotting + self.add_met_config(name='cnt', + data_type='list', + env_var_name='STAT_LIST', + metplus_configs=nicknames) + c_dict['STAT_LIST'] = getlist( + self.get_env_var_value('METPLUS_STAT_LIST') + ) + + value = ('list', None, None, nicknames) + output_stats_dict[key] = value + self.add_met_config_dict('output_stats', output_stats_dict) + if not c_dict['STAT_LIST']: self.log_error("Must set SERIES_ANALYSIS_STAT_LIST to run.") - # set stat list to set output_stats.cnt in MET config file + + # set legacy stat list to set output_stats.cnt in MET config file self.add_met_config(name='cnt', data_type='list', env_var_name='METPLUS_STAT_LIST', metplus_configs=['SERIES_ANALYSIS_STAT_LIST', 'SERIES_ANALYSIS_CNT']) - # set cts list to set output_stats.cts in MET config file + # set legacy cts list to set output_stats.cts in MET config file self.add_met_config(name='cts', data_type='list', env_var_name='METPLUS_CTS_LIST', diff --git a/metplus/wrappers/tc_pairs_wrapper.py b/metplus/wrappers/tc_pairs_wrapper.py index c3e6a67a5b..369779ed43 100755 --- a/metplus/wrappers/tc_pairs_wrapper.py +++ b/metplus/wrappers/tc_pairs_wrapper.py @@ -61,6 +61,8 @@ class TCPairsWrapper(CommandBuilder): 'METPLUS_WRITE_VALID', 'METPLUS_VALID_INC', 'METPLUS_VALID_EXC', + 'METPLUS_CHECK_DUP', + 'METPLUS_INTERP12', ] WILDCARDS = { @@ -169,6 +171,14 @@ def create_c_dict(self): self.handle_consensus() + self.add_met_config(name='check_dup', + data_type='bool') + + self.add_met_config(name='interp12', + data_type='string', + extra_args={'remove_quotes': True, + 'uppercase': True}) + c_dict['INIT_INCLUDE'] = getlist( self.get_wrapper_or_generic_config('INIT_INCLUDE') ) diff --git a/parm/met_config/GridStatConfig_wrapped b/parm/met_config/GridStatConfig_wrapped index fdaf8cf209..29abe3a6d2 100644 --- a/parm/met_config/GridStatConfig_wrapped +++ b/parm/met_config/GridStatConfig_wrapped @@ -35,8 +35,10 @@ ${METPLUS_REGRID_DICT} //////////////////////////////////////////////////////////////////////////////// -censor_thresh = []; -censor_val = []; +//censor_thresh = +${METPLUS_CENSOR_THRESH} +//censor_val = +${METPLUS_CENSOR_VAL} cat_thresh = []; cnt_thresh = [ NA ]; cnt_logic = UNION; @@ -134,10 +136,8 @@ nbrhd = { // Fourier decomposition // May be set separately in each "obs.field" entry // -fourier = { - wave_1d_beg = []; - wave_1d_end = []; -} +//fourier = { +${METPLUS_FOURIER_DICT} //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/met_config/MODEConfig_wrapped b/parm/met_config/MODEConfig_wrapped index 5f0442addc..a5ae8e4d4b 100644 --- a/parm/met_config/MODEConfig_wrapped +++ b/parm/met_config/MODEConfig_wrapped @@ -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} + //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/met_config/PB2NCConfig_wrapped b/parm/met_config/PB2NCConfig_wrapped index 25cab0375b..4701ccf25c 100644 --- a/parm/met_config/PB2NCConfig_wrapped +++ b/parm/met_config/PB2NCConfig_wrapped @@ -94,26 +94,13 @@ ${METPLUS_OBS_BUFR_VAR} // Mapping of BUFR variable name to GRIB name. The default map is defined at // obs_prepbufr_map. This replaces/expends the default map. // -obs_bufr_map = []; +//obs_bufr_map = +${METPLUS_OBS_BUFR_MAP} // This map is for PREPBUFR. It will be added into obs_bufr_map. // Please do not override this map. -obs_prefbufr_map = [ - { key = "POB"; val = "PRES"; }, - { key = "QOB"; val = "SPFH"; }, - { key = "TOB"; val = "TMP"; }, - { key = "ZOB"; val = "HGT"; }, - { key = "UOB"; val = "UGRD"; }, - { key = "VOB"; val = "VGRD"; }, - { key = "D_DPT"; val = "DPT"; }, - { key = "D_WDIR"; val = "WDIR"; }, - { key = "D_WIND"; val = "WIND"; }, - { key = "D_RH"; val = "RH"; }, - { key = "D_MIXR"; val = "MIXR"; }, - { key = "D_PRMSL"; val = "PRMSL"; }, - { key = "D_PBL"; val = "PBL"; }, - { key = "D_CAPE"; val = "CAPE"; } -]; +//obs_prepbufr_map = +${METPLUS_OBS_PREPBUFR_MAP} //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/met_config/PointStatConfig_wrapped b/parm/met_config/PointStatConfig_wrapped index 824aed7145..9ab367e182 100644 --- a/parm/met_config/PointStatConfig_wrapped +++ b/parm/met_config/PointStatConfig_wrapped @@ -77,14 +77,8 @@ obs_perc_value = 50; // // Mapping of message type group name to comma-separated list of values. // -message_type_group_map = [ - { key = "SURFACE"; val = "ADPSFC,SFCSHP,MSONET"; }, - { key = "ANYAIR"; val = "AIRCAR,AIRCFT"; }, - { key = "ANYSFC"; val = "ADPSFC,SFCSHP,ADPUPA,PROFLR,MSONET"; }, - { key = "ONLYSF"; val = "ADPSFC,SFCSHP"; }, - { key = "LANDSF"; val = "ADPSFC,MSONET"; }, - { key = "WATERSF"; val = "SFCSHP"; } -]; +//message_type_group_map = +${METPLUS_MESSAGE_TYPE_GROUP_MAP} //////////////////////////////////////////////////////////////////////////////// @@ -121,7 +115,8 @@ mask = { ${METPLUS_MASK_GRID} ${METPLUS_MASK_POLY} ${METPLUS_MASK_SID} - llpnt = []; + //llpnt = + ${METPLUS_MASK_LLPNT} } //////////////////////////////////////////////////////////////////////////////// @@ -152,13 +147,8 @@ ${METPLUS_INTERP_DICT} // // HiRA verification method // -hira = { - flag = FALSE; - width = [ 2, 3, 4, 5 ]; - vld_thresh = 1.0; - cov_thresh = [ ==0.25 ]; - shape = SQUARE; -} +//hira = { +${METPLUS_HIRA_DICT} //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/met_config/SeriesAnalysisConfig_wrapped b/parm/met_config/SeriesAnalysisConfig_wrapped index 94fd1b2629..a8cf1af226 100644 --- a/parm/met_config/SeriesAnalysisConfig_wrapped +++ b/parm/met_config/SeriesAnalysisConfig_wrapped @@ -102,20 +102,8 @@ ${METPLUS_VLD_THRESH} // // Statistical output types // -output_stats = { - fho = []; - ctc = []; - ${METPLUS_CTS_LIST} - mctc = []; - mcts = []; - ${METPLUS_STAT_LIST} - sl1l2 = []; - sal1l2 = []; - pct = []; - pstd = []; - pjc = []; - prc = []; -} +//output_stats = { +${METPLUS_OUTPUT_STATS_DICT} //////////////////////////////////////////////////////////////////////////////// diff --git a/parm/met_config/TCPairsConfig_wrapped b/parm/met_config/TCPairsConfig_wrapped index ce13c1db82..67246863de 100644 --- a/parm/met_config/TCPairsConfig_wrapped +++ b/parm/met_config/TCPairsConfig_wrapped @@ -82,13 +82,16 @@ valid_mask = ""; // // Specify if the code should check for duplicate ATCF lines // -check_dup = FALSE; +//check_dup = +${METPLUS_CHECK_DUP} + // // Specify special processing to be performed for interpolated models. // Set to NONE, FILL, or REPLACE. // -interp12 = REPLACE; +//interp12 = +${METPLUS_INTERP12} // // Specify how consensus forecasts should be defined diff --git a/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf b/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf index d9d6d475ef..e4316e8641 100644 --- a/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf +++ b/parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf @@ -174,3 +174,9 @@ 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 = + +#GRID_STAT_CENSOR_THRESH = +#GRID_STAT_CENSOR_VAL = diff --git a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf index 35bc4c2f6d..6cbc269527 100644 --- a/parm/use_cases/met_tool_wrapper/MODE/MODE.conf +++ b/parm/use_cases/met_tool_wrapper/MODE/MODE.conf @@ -1,7 +1,5 @@ [config] -# MODE METplus Configuration - PROCESS_LIST = MODE LOOP_ORDER = times @@ -119,3 +117,6 @@ MODE_GRID_RES = 40 #MODE_NC_PAIRS_FLAG_POLYLINES = MODE_QUILT = True + +#MODE_PS_PLOT_FLAG = +#MODE_CT_STATS_FLAG = diff --git a/parm/use_cases/met_tool_wrapper/PB2NC/PB2NC.conf b/parm/use_cases/met_tool_wrapper/PB2NC/PB2NC.conf index 14cc9b405f..a919fc00b9 100644 --- a/parm/use_cases/met_tool_wrapper/PB2NC/PB2NC.conf +++ b/parm/use_cases/met_tool_wrapper/PB2NC/PB2NC.conf @@ -1,78 +1,34 @@ -# PrepBufr to NetCDF Configurations - -# section heading for [config] variables - all items below this line and -# before the next section heading correspond to the [config] section [config] -# List of applications to run - only PB2NC for this case PROCESS_LIST = PB2NC -# time looping - options are INIT, VALID, RETRO, and REALTIME -# If set to INIT or RETRO: -# INIT_TIME_FMT, INIT_BEG, INIT_END, and INIT_INCREMENT must also be set -# If set to VALID or REALTIME: -# VALID_TIME_FMT, VALID_BEG, VALID_END, and VALID_INCREMENT must also be set LOOP_BY = VALID - -# Format of VALID_BEG and VALID_END using % items -# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. -# see www.strftime.org for more information -# %Y%m%d%H expands to YYYYMMDDHH VALID_TIME_FMT = %Y%m%d%H - -# Start time for METplus run - must match VALID_TIME_FMT VALID_BEG = 2007033112 - -# End time for METplus run - must match VALID_TIME_FMT VALID_END = 2007033112 - -# Increment between METplus runs (in seconds if no units are specified) -# Must be >= 60 seconds VALID_INCREMENT = 1M -# List of forecast leads to process for each run time (init or valid) -# In hours if units are not specified -# If unset, defaults to 0 (don't loop through forecast leads) LEAD_SEQ = 0 -# list of offsets in the prepBUFR input filenames to allow. List is in order of preference -# i.e. if 12, 6 is listed, it will try to use a 12 offset file and then try to use a 6 offset -# if the 12 does not exist PB2NC_OFFSETS = 12 -# Order of loops to process data - Options are times, processes -# Not relevant if only one item is in the PROCESS_LIST -# times = run all wrappers in the PROCESS_LIST for a single run time, then -# increment the run time and run all wrappers again until all times have -# been evaluated. -# processes = run the first wrapper in the PROCESS_LIST for all times -# specified, then repeat for the next item in the PROCESS_LIST until all -# wrappers have been run -LOOP_ORDER = processes - -# Location of MET config file to pass to PB2NC -# References CONFIG_DIR from the [dir] section -PB2NC_CONFIG_FILE = {CONFIG_DIR}/PB2NCConfig_wrapped - -# If set to True, skip run if the output file determined by the output directory and -# filename template already exists PB2NC_SKIP_IF_OUTPUT_EXISTS = True -# 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 PB2NC config file +PB2NC_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_obs/prepbufr +PB2NC_INPUT_TEMPLATE = ndas.t{da_init?fmt=%2H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}.nr + +PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/pb2nc +PB2NC_OUTPUT_TEMPLATE = sample_pb.nc + + +PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NCConfig_wrapped + PB2NC_WINDOW_BEGIN = -1800 PB2NC_WINDOW_END = 1800 -# controls the window of time around the current run time to be considered to be valid for all -# input files, not just relative to each input files valid time -# if set, these values are substituted with the times from the current run time and passed to -# PB2NC on the command line with -valid_beg and -valid_end arguments. -# Not used if unset or set to an empty string PB2NC_VALID_BEGIN = {valid?fmt=%Y%m%d_%H} PB2NC_VALID_END = {valid?fmt=%Y%m%d_%H?shift=1d} -# Values to pass to pb2nc config file using environment variables of the same name. -# See MET User's Guide for more information PB2NC_GRID = G212 PB2NC_POLY = PB2NC_STATION_ID = @@ -90,8 +46,6 @@ PB2NC_QUALITY_MARK_THRESH = 3 # Leave empty to process all PB2NC_OBS_BUFR_VAR_LIST = QOB, TOB, ZOB, UOB, VOB, D_DPT, D_WIND, D_RH, D_MIXR -# For defining the time periods for summarization - PB2NC_TIME_SUMMARY_FLAG = False PB2NC_TIME_SUMMARY_BEG = 000000 PB2NC_TIME_SUMMARY_END = 235959 @@ -105,22 +59,5 @@ PB2NC_TIME_SUMMARY_GRIB_CODES = PB2NC_TIME_SUMMARY_VALID_FREQ = 0 PB2NC_TIME_SUMMARY_VALID_THRESH = 0.0 -# End of [config] section and start of [dir] section -[dir] -# location of configuration files used by MET applications -CONFIG_DIR = {PARM_BASE}/met_config - -# directory containing input to PB2NC -PB2NC_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_obs/prepbufr - -# directory to write output from PB2NC -PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/pb2nc - - -# End of [dir] section and start of [filename_templates] section -[filename_templates] -# Template to look for forecast input to PB2NC relative to PB2NC_INPUT_DIR -PB2NC_INPUT_TEMPLATE = ndas.t{da_init?fmt=%2H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}.nr - -# Template to use to write output from PB2NC -PB2NC_OUTPUT_TEMPLATE = sample_pb.nc +#PB2NC_OBS_BUFR_MAP = +#PB2NC_OBS_PREPBUFR_MAP = diff --git a/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf b/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf index 36875e0a79..cc43470edb 100644 --- a/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf +++ b/parm/use_cases/met_tool_wrapper/PointStat/PointStat.conf @@ -1,56 +1,73 @@ [config] -# List of applications to run - only PointStat for this case PROCESS_LIST = PointStat -# time looping - options are INIT, VALID, RETRO, and REALTIME -# If set to INIT or RETRO: -# INIT_TIME_FMT, INIT_BEG, INIT_END, and INIT_INCREMENT must also be set -# If set to VALID or REALTIME: -# VALID_TIME_FMT, VALID_BEG, VALID_END, and VALID_INCREMENT must also be set -LOOP_BY = INIT +### +# Time Info +### -# Format of INIT_BEG and INIT_END using % items -# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc. -# see www.strftime.org for more information -# %Y%m%d%H expands to YYYYMMDDHH +LOOP_BY = INIT INIT_TIME_FMT = %Y%m%d - -# Start time for METplus run - must match INIT_TIME_FMT INIT_BEG = 20070330 - -# End time for METplus run - must match INIT_TIME_FMT INIT_END = 20070330 - -# Increment between METplus runs (in seconds if no units are specified) -# Must be >= 60 seconds INIT_INCREMENT = 1M -# List of forecast leads to process for each run time (init or valid) -# In hours if units are not specified -# If unset, defaults to 0 (don't loop through forecast leads) LEAD_SEQ = 36 -# Order of loops to process data - Options are times, processes -# Not relevant if only one item is in the PROCESS_LIST -# times = run all wrappers in the PROCESS_LIST for a single run time, then -# increment the run time and run all wrappers again until all times have -# been evaluated. -# processes = run the first wrapper in the PROCESS_LIST for all times -# specified, then repeat for the next item in the PROCESS_LIST until all -# wrappers have been run -LOOP_ORDER = processes - -# Verbosity of MET output - overrides LOG_VERBOSITY for PointStat only +### +# File I/O +### + +FCST_POINT_STAT_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst +FCST_POINT_STAT_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/nam.t00z.awip1236.tm00.{init?fmt=%Y%m%d}.grb + +OBS_POINT_STAT_INPUT_DIR = {INPUT_BASE}/met_test/out/pb2nc +OBS_POINT_STAT_INPUT_TEMPLATE = sample_pb.nc + +POINT_STAT_OUTPUT_DIR = {OUTPUT_BASE}/point_stat + +POINT_STAT_CLIMO_MEAN_INPUT_DIR = +POINT_STAT_CLIMO_MEAN_INPUT_TEMPLATE = + +POINT_STAT_CLIMO_STDEV_INPUT_DIR = +POINT_STAT_CLIMO_STDEV_INPUT_TEMPLATE = + + +### +# Field Info +### + +POINT_STAT_ONCE_PER_FIELD = False + +FCST_VAR1_NAME = TMP +FCST_VAR1_LEVELS = P750-900 +FCST_VAR1_THRESH = <=273, >273 +OBS_VAR1_NAME = TMP +OBS_VAR1_LEVELS = P750-900 +OBS_VAR1_THRESH = <=273, >273 + +FCST_VAR2_NAME = UGRD +FCST_VAR2_LEVELS = Z10 +FCST_VAR2_THRESH = >=5 +OBS_VAR2_NAME = UGRD +OBS_VAR2_LEVELS = Z10 +OBS_VAR2_THRESH = >=5 + +FCST_VAR3_NAME = VGRD +FCST_VAR3_LEVELS = Z10 +FCST_VAR3_THRESH = >=5 +OBS_VAR3_NAME = VGRD +OBS_VAR3_LEVELS = Z10 +OBS_VAR3_THRESH = >=5 + +### +# PointStat +### + #LOG_POINT_STAT_VERBOSITY = 2 -# Location of MET config file to pass to GridStat -# References PARM_BASE which is the location of the parm directory corresponding -# to the ush directory of the run_metplus.py script that is called -# or the value of the environment variable METPLUS_PARM_BASE if set POINT_STAT_CONFIG_FILE ={PARM_BASE}/met_config/PointStatConfig_wrapped - #POINT_STAT_OBS_QUALITY_INC = 1, 2, 3 #POINT_STAT_OBS_QUALITY_EXC = @@ -89,115 +106,37 @@ POINT_STAT_OUTPUT_FLAG_VL1L2 = STAT #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 OBS_POINT_STAT_WINDOW_END = 5400 -# Optional list of offsets to look for point observation data POINT_STAT_OFFSETS = 0 -# Model/fcst and obs name, e.g. GFS, NAM, GDAS, etc. MODEL = WRF POINT_STAT_DESC = NA OBTYPE = -# Regrid to specified grid. Indicate NONE if no regridding, or the grid id -# (e.g. G212) POINT_STAT_REGRID_TO_GRID = NONE POINT_STAT_REGRID_METHOD = BILIN POINT_STAT_REGRID_WIDTH = 2 POINT_STAT_OUTPUT_PREFIX = -# sets the -obs_valid_beg command line argument (optional) -# not used for this example #POINT_STAT_OBS_VALID_BEG = {valid?fmt=%Y%m%d_%H} - -# sets the -obs_valid_end command line argument (optional) -# not used for this example #POINT_STAT_OBS_VALID_END = {valid?fmt=%Y%m%d_%H} -# Verification Masking regions -# Indicate which grid and polygon masking region, if applicable -POINT_STAT_GRID = DTC165, DTC166 - -# List of full path to poly masking files. NOTE: Only short lists of poly -# files work (those that fit on one line), a long list will result in an -# environment variable that is too long, resulting in an error. For long -# lists of poly masking files (i.e. all the mask files in the NCEP_mask -# directory), define these in the MET point_stat configuration file. -POINT_STAT_POLY = MET_BASE/poly/LMV.poly -POINT_STAT_STATION_ID = +POINT_STAT_MASK_GRID = DTC165, DTC166 +POINT_STAT_MASK_POLY = MET_BASE/poly/LMV.poly +POINT_STAT_MASK_SID = +#POINT_STAT_MASK_LLPNT = -# Message types, if all message types are to be returned, leave this empty, -# otherwise indicate the message types of interest. POINT_STAT_MESSAGE_TYPE = ADPUPA, ADPSFC -# Variables and levels as specified in the field dictionary of the MET -# point_stat configuration file. Specify as FCST_VARn_NAME, FCST_VARn_LEVELS, -# (optional) FCST_VARn_OPTION - -# set to True to run PointStat once for each name/level combination -# set to False to run PointStat once per run time including all fields -POINT_STAT_ONCE_PER_FIELD = False - -# fields to compare -# Note: If FCST_VAR_* is set, then a corresponding OBS_VAR_* variable must be set -# To use one variables for both forecast and observation data, set BOTH_VAR_* instead -FCST_VAR1_NAME = TMP -FCST_VAR1_LEVELS = P750-900 -FCST_VAR1_THRESH = <=273, >273 -OBS_VAR1_NAME = TMP -OBS_VAR1_LEVELS = P750-900 -OBS_VAR1_THRESH = <=273, >273 - -FCST_VAR2_NAME = UGRD -FCST_VAR2_LEVELS = Z10 -FCST_VAR2_THRESH = >=5 -OBS_VAR2_NAME = UGRD -OBS_VAR2_LEVELS = Z10 -OBS_VAR2_THRESH = >=5 - -FCST_VAR3_NAME = VGRD -FCST_VAR3_LEVELS = Z10 -FCST_VAR3_THRESH = >=5 -OBS_VAR3_NAME = VGRD -OBS_VAR3_LEVELS = Z10 -OBS_VAR3_THRESH = >=5 - - -# End of [config] section and start of [dir] section -[dir] -FCST_POINT_STAT_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst -OBS_POINT_STAT_INPUT_DIR = {INPUT_BASE}/met_test/out/pb2nc - -# directory containing climatology mean input to PointStat -# Not used in this example -POINT_STAT_CLIMO_MEAN_INPUT_DIR = - -# directory containing climatology mean input to PointStat -# Not used in this example -POINT_STAT_CLIMO_STDEV_INPUT_DIR = - -POINT_STAT_OUTPUT_DIR = {OUTPUT_BASE}/point_stat - - -# End of [dir] section and start of [filename_templates] section -[filename_templates] - -# Template to look for forecast input to PointStat relative to FCST_POINT_STAT_INPUT_DIR -FCST_POINT_STAT_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/nam.t00z.awip1236.tm00.{init?fmt=%Y%m%d}.grb - -# Template to look for observation input to PointStat relative to OBS_POINT_STAT_INPUT_DIR -OBS_POINT_STAT_INPUT_TEMPLATE = sample_pb.nc - -# Template to look for climatology input to PointStat relative to POINT_STAT_CLIMO_MEAN_INPUT_DIR -# Not used in this example -POINT_STAT_CLIMO_MEAN_INPUT_TEMPLATE = - -# Template to look for climatology input to PointStat relative to POINT_STAT_CLIMO_STDEV_INPUT_DIR -# Not used in this example -POINT_STAT_CLIMO_STDEV_INPUT_TEMPLATE = +#POINT_STAT_HIRA_FLAG = +#POINT_STAT_HIRA_WIDTH = +#POINT_STAT_HIRA_VLD_THRESH = +#POINT_STAT_HIRA_COV_THRESH = +#POINT_STAT_HIRA_SHAPE = +#POINT_STAT_HIRA_PROB_CAT_THRESH = +#POINT_STAT_MESSAGE_TYPE_GROUP_MAP = diff --git a/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf b/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf index 8f450802a1..230c081f1d 100644 --- a/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf +++ b/parm/use_cases/met_tool_wrapper/SeriesAnalysis/SeriesAnalysis.conf @@ -1,54 +1,86 @@ -# SeriesAnalysis METplus Configuration - [config] PROCESS_LIST = SeriesAnalysis -LOOP_BY = INIT +### +# Time Info +### +LOOP_BY = INIT INIT_TIME_FMT = %Y%m%d%H - INIT_BEG=2005080700 - INIT_END=2005080700 - INIT_INCREMENT = 12H LEAD_SEQ = 12, 9, 6 -SERIES_ANALYSIS_CUSTOM_LOOP_LIST = +SERIES_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID -LOOP_ORDER = processes +SERIES_ANALYSIS_RUN_ONCE_PER_STORM_ID = False -#LOG_SERIES_ANALYSIS_VERBOSITY = 2 +SERIES_ANALYSIS_CUSTOM_LOOP_LIST = -SERIES_ANALYSIS_IS_PAIRED = False +### +# File I/O +### -SERIES_ANALYSIS_GENERATE_PLOTS = no +FCST_SERIES_ANALYSIS_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst +FCST_SERIES_ANALYSIS_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/wrfprs_ruc13_{lead?fmt=%2H}.tm00_G212 -PLOT_DATA_PLANE_TITLE = +OBS_SERIES_ANALYSIS_INPUT_DIR = {INPUT_BASE}/met_test/new +OBS_SERIES_ANALYSIS_INPUT_TEMPLATE = ST2ml{valid?fmt=%Y%m%d%H}_A03h.nc -SERIES_ANALYSIS_GENERATE_ANIMATIONS = no +SERIES_ANALYSIS_TC_STAT_INPUT_DIR = +SERIES_ANALYSIS_TC_STAT_INPUT_TEMPLATE = + +SERIES_ANALYSIS_OUTPUT_DIR = {OUTPUT_BASE}/met_tool_wrapper/SeriesAnalysis +SERIES_ANALYSIS_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H}_sa.nc + +SERIES_ANALYSIS_CLIMO_MEAN_INPUT_DIR = +SERIES_ANALYSIS_CLIMO_MEAN_INPUT_TEMPLATE = + +SERIES_ANALYSIS_CLIMO_STDEV_INPUT_DIR = +SERIES_ANALYSIS_CLIMO_STDEV_INPUT_TEMPLATE = + + +### +# Field Info +### + +MODEL = WRF +OBTYPE = MC_PCP + +FCST_VAR1_NAME = APCP +FCST_VAR1_LEVELS = A03 + +OBS_VAR1_NAME = APCP_03 +OBS_VAR1_LEVELS = "(*,*)" + +BOTH_VAR1_THRESH = gt12.7, gt25.4, gt50.8, gt76.2 -SERIES_ANALYSIS_CONFIG_FILE = {CONFIG_DIR}/SeriesAnalysisConfig_wrapped +### +# SeriesAnalysis +### -SERIES_ANALYSIS_STAT_LIST = TOTAL, RMSE, FBAR, OBAR +#LOG_SERIES_ANALYSIS_VERBOSITY = 2 + +SERIES_ANALYSIS_CONFIG_FILE = {PARM_BASE}/met_config/SeriesAnalysisConfig_wrapped -SERIES_ANALYSIS_DESC = +SERIES_ANALYSIS_IS_PAIRED = False -SERIES_ANALYSIS_CAT_THRESH = +#SERIES_ANALYSIS_DESC = -SERIES_ANALYSIS_VLD_THRESH = +#SERIES_ANALYSIS_CAT_THRESH = -SERIES_ANALYSIS_BLOCK_SIZE = +#SERIES_ANALYSIS_VLD_THRESH = -SERIES_ANALYSIS_CTS_LIST = +#SERIES_ANALYSIS_BLOCK_SIZE = -SERIES_ANALYSIS_REGRID_TO_GRID = -SERIES_ANALYSIS_REGRID_METHOD = -SERIES_ANALYSIS_REGRID_WIDTH = -SERIES_ANALYSIS_REGRID_VLD_THRESH = -SERIES_ANALYSIS_REGRID_SHAPE = +#SERIES_ANALYSIS_REGRID_TO_GRID = +#SERIES_ANALYSIS_REGRID_METHOD = +#SERIES_ANALYSIS_REGRID_WIDTH = +#SERIES_ANALYSIS_REGRID_VLD_THRESH = +#SERIES_ANALYSIS_REGRID_SHAPE = #SERIES_ANALYSIS_CLIMO_MEAN_FILE_NAME = #SERIES_ANALYSIS_CLIMO_MEAN_FIELD = @@ -74,51 +106,31 @@ SERIES_ANALYSIS_REGRID_SHAPE = #SERIES_ANALYSIS_HSS_EC_VALUE = -SERIES_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID +#FCST_SERIES_ANALYSIS_PROB_THRESH = -SERIES_ANALYSIS_RUN_ONCE_PER_STORM_ID = False +#SERIES_ANALYSIS_OUTPUT_STATS_FHO = +#SERIES_ANALYSIS_OUTPUT_STATS_CTC = +#SERIES_ANALYSIS_OUTPUT_STATS_CTS = +#SERIES_ANALYSIS_OUTPUT_STATS_MCTC = +#SERIES_ANALYSIS_OUTPUT_STATS_MCTS = -MODEL = WRF +SERIES_ANALYSIS_OUTPUT_STATS_CNT = TOTAL, RMSE, FBAR, OBAR -OBTYPE = MC_PCP - -#FCST_SERIES_ANALYSIS_PROB_THRESH = +#SERIES_ANALYSIS_OUTPUT_STATS_SL1L2 = +#SERIES_ANALYSIS_OUTPUT_STATS_SAL1L2 = +#SERIES_ANALYSIS_OUTPUT_STATS_PCT = +#SERIES_ANALYSIS_OUTPUT_STATS_PSTD = +#SERIES_ANALYSIS_OUTPUT_STATS_PJC = +#SERIES_ANALYSIS_OUTPUT_STATS_PRC = -FCST_VAR1_NAME = APCP - -FCST_VAR1_LEVELS = A03 -OBS_VAR1_NAME = APCP_03 - -OBS_VAR1_LEVELS = "(*,*)" - -BOTH_VAR1_THRESH = gt12.7, gt25.4, gt50.8, gt76.2 - -[dir] -CONFIG_DIR={PARM_BASE}/met_config - -FCST_SERIES_ANALYSIS_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst - -OBS_SERIES_ANALYSIS_INPUT_DIR = {INPUT_BASE}/met_test/new +### +# Plotting +### -SERIES_ANALYSIS_CLIMO_MEAN_INPUT_DIR = - -SERIES_ANALYSIS_CLIMO_STDEV_INPUT_DIR = - -SERIES_ANALYSIS_TC_STAT_INPUT_DIR = - -SERIES_ANALYSIS_OUTPUT_DIR = {OUTPUT_BASE}/met_tool_wrapper/SeriesAnalysis - -[filename_templates] - -FCST_SERIES_ANALYSIS_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/wrfprs_ruc13_{lead?fmt=%2H}.tm00_G212 - -OBS_SERIES_ANALYSIS_INPUT_TEMPLATE = ST2ml{valid?fmt=%Y%m%d%H}_A03h.nc - -SERIES_ANALYSIS_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H}_sa.nc +SERIES_ANALYSIS_GENERATE_PLOTS = no -SERIES_ANALYSIS_CLIMO_MEAN_INPUT_TEMPLATE = +PLOT_DATA_PLANE_TITLE = -SERIES_ANALYSIS_CLIMO_STDEV_INPUT_TEMPLATE = +SERIES_ANALYSIS_GENERATE_ANIMATIONS = no -SERIES_ANALYSIS_TC_STAT_INPUT_TEMPLATE = diff --git a/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_extra_tropical.conf b/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_extra_tropical.conf index 62640e4ba8..255d41c784 100644 --- a/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_extra_tropical.conf +++ b/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_extra_tropical.conf @@ -1,37 +1,55 @@ -# -# CONFIGURATION -# [config] -# Looping by processes: run each 'task' in the PROCESS_LIST for all -# defined times then steps to the next 'task'. -LOOP_ORDER = processes - -# Configuration files -TC_PAIRS_CONFIG_FILE = {CONFIG_DIR}/TCPairsConfig_wrapped - PROCESS_LIST = TCPairs -# The init time begin and end times, increment +### +# Time Info +### + LOOP_BY = INIT INIT_TIME_FMT = %Y%m%d%H INIT_BEG = 2014121318 INIT_END = 2014121318 - -# This is the step-size. Increment in seconds from the begin time to the end -# time INIT_INCREMENT = 21600 ;; set to every 6 hours=21600 seconds TC_PAIRS_RUN_ONCE = True -# A list of times to include, in format YYYYMMDD_hh -TC_PAIRS_INIT_INCLUDE = -# A list of times to exclude, in format YYYYMMDD_hh +### +# File I/O +### + +TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/met_test/new/track_data +TC_PAIRS_ADECK_TEMPLATE = {date?fmt=%Y%m}/a{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s} + +TC_PAIRS_BDECK_INPUT_DIR = {TC_PAIRS_ADECK_INPUT_DIR} +TC_PAIRS_BDECK_TEMPLATE = {date?fmt=%Y%m}/b{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s} + +TC_PAIRS_REFORMAT_DIR = {OUTPUT_BASE}/track_data_atcf + +TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs +TC_PAIRS_OUTPUT_TEMPLATE = {date?fmt=%Y%m}/{basin?fmt=%s}q{date?fmt=%Y%m%d%H}.gfso.{cyclone?fmt=%s} + + +TC_PAIRS_SKIP_IF_OUTPUT_EXISTS = yes +TC_PAIRS_SKIP_IF_REFORMAT_EXISTS = yes + +TC_PAIRS_READ_ALL_FILES = no +#TC_PAIRS_SKIP_LEAD_SEQ = False + +TC_PAIRS_REFORMAT_DECK = yes +TC_PAIRS_REFORMAT_TYPE = SBU + + +### +# TCPairs +### + +TC_PAIRS_CONFIG_FILE = {PARM_BASE}/met_config/TCPairsConfig_wrapped + +TC_PAIRS_INIT_INCLUDE = TC_PAIRS_INIT_EXCLUDE = -# Specify model init time window in format YYYYMM[DD[_hh]] -# Only tracks that fall within the initialization time window will be used TC_PAIRS_INIT_BEG = 2014121318 TC_PAIRS_INIT_END = 2014121418 @@ -40,55 +58,20 @@ TC_PAIRS_INIT_END = 2014121418 #TC_PAIRS_WRITE_VALID = -# Specify model valid time window in format YYYYMM[DD[_hh]] -# Only tracks that fall within the valid time window will be used TC_PAIRS_VALID_BEG = TC_PAIRS_VALID_END = -# Skip looping over forecast leads if a list is provided -#TC_PAIRS_SKIP_LEAD_SEQ = False - - -## -# -# MET TC-Pairs -# -## - -# -# Run MET tc_pairs by indicating the top-level directories for the A-deck -# and B-deck files. Set to 'yes' to run using top-level directories, 'no' -# if you want to run tc_pairs on files paired by the wrapper. -TC_PAIRS_READ_ALL_FILES = no - -# List of models to be used (white space or comma separated) eg: DSHP, LGEM, HWRF -# If no models are listed, then process all models in the input file(s). MODEL = #TC_PAIRS_DESC = -# List of storm ids of interest (space or comma separated) e.g.: AL112012, AL122012 -# If no storm ids are listed, then process all storm ids in the input file(s). TC_PAIRS_STORM_ID = - -# Basins (of origin/region). Indicate with space or comma-separated list of regions, eg. AL: for North Atlantic, -# WP: Western North Pacific, CP: Central North Pacific, SH: Southern Hemisphere, IO: North Indian Ocean, LS: Southern -# Hemisphere TC_PAIRS_BASIN = - -# Cyclone, a space or comma-separated list of cyclone numbers. If left empty, all cyclones will be used. TC_PAIRS_CYCLONE = - -# Storm name, a space or comma-separated list of storm names to evaluate. If left empty, all storms will be used. TC_PAIRS_STORM_NAME = -# DLAND file, the full path of the file that contains the gridded representation of the -# minimum distance from land. TC_PAIRS_DLAND_FILE = {MET_INSTALL_DIR}/share/met/tc_data/dland_global_tenth_degree.nc -TC_PAIRS_REFORMAT_DECK = yes -TC_PAIRS_REFORMAT_TYPE = SBU - TC_PAIRS_MISSING_VAL_TO_REPLACE = -99 TC_PAIRS_MISSING_VAL = -9999 @@ -97,43 +80,6 @@ TC_PAIRS_MISSING_VAL = -9999 #TC_PAIRS_CONSENSUS1_REQUIRED = #TC_PAIRS_CONSENSUS1_MIN_REQ = -# OVERWRITE OPTIONS -# Don't overwrite filter files if they already exist. -# Set to no if you do NOT want to override existing files -# Set to yes if you do want to override existing files - -# overwrite modified track data (non-ATCF to ATCF format) -TC_PAIRS_SKIP_IF_REFORMAT_EXISTS = yes - -# overwrite tc_pairs output -TC_PAIRS_SKIP_IF_OUTPUT_EXISTS = yes - -# FILENAME TEMPLATES -# -[filename_templates] -# Define the format of the filenames -TC_PAIRS_ADECK_TEMPLATE = {date?fmt=%Y%m}/a{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s} -TC_PAIRS_BDECK_TEMPLATE = {date?fmt=%Y%m}/b{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s} -TC_PAIRS_OUTPUT_TEMPLATE = {date?fmt=%Y%m}/{basin?fmt=%s}q{date?fmt=%Y%m%d%H}.gfso.{cyclone?fmt=%s} - -# -# DIRECTORIES -# -[dir] - -# MET config directory, location of configuration files used by MET applications -# CONFIG_DIR and the value it expands to is set as an environment variable -# and is used in the MET configuration file. -CONFIG_DIR={PARM_BASE}/met_config - -# track data, set to your data source -TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/met_test/new/track_data -TC_PAIRS_BDECK_INPUT_DIR = {TC_PAIRS_ADECK_INPUT_DIR} -TC_PAIRS_REFORMAT_DIR = {OUTPUT_BASE}/track_data_atcf -TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs - - -# REGEX PATTERNS -# -[regex_pattern] +#TC_PAIRS_CHECK_DUP = +#TC_PAIRS_INTERP12 = diff --git a/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf b/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf index 81f9ed99c0..2812a0cc16 100644 --- a/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf +++ b/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf @@ -1,39 +1,54 @@ -# -# CONFIGURATION -# [config] -# Looping by times: steps through each 'task' in the PROCESS_LIST for each -# defined time, and repeats until all times have been evaluated. -LOOP_ORDER = times - -# Configuration files -TC_PAIRS_CONFIG_FILE = {PARM_BASE}/met_config/TCPairsConfig_wrapped - -# 'Tasks' to be run PROCESS_LIST = TCPairs -LOOP_BY = INIT +### +# Time Info +### -# The init time begin and end times, increment, and last init hour. +LOOP_BY = INIT INIT_TIME_FMT = %Y%m%d%H INIT_BEG = 2018083006 INIT_END = 2018083018 - -# This is the step-size. Increment in seconds from the begin time to the end time -# set to 6 hours = 21600 seconds INIT_INCREMENT = 21600 +#TC_PAIRS_SKIP_LEAD_SEQ = False + +LOOP_ORDER = times + TC_PAIRS_RUN_ONCE = False -# A list of times to include, in format YYYYMMDD_hh -TC_PAIRS_INIT_INCLUDE = -# A list of times to exclude, in format YYYYMMDD_hh +### +# File I/O +### + +TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/met_test/new/hwrf/adeck +TC_PAIRS_ADECK_TEMPLATE = {model?fmt=%s}/*{cyclone?fmt=%s}l.{date?fmt=%Y%m%d%H}.trak.hwrf.atcfunix + +TC_PAIRS_BDECK_INPUT_DIR = {INPUT_BASE}/met_test/new/hwrf/bdeck +TC_PAIRS_BDECK_TEMPLATE = b{basin?fmt=%s}{cyclone?fmt=%s}{date?fmt=%Y}.dat + +TC_PAIRS_EDECK_INPUT_DIR = +TC_PAIRS_EDECK_TEMPLATE = + +TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs +TC_PAIRS_OUTPUT_TEMPLATE = tc_pairs_{basin?fmt=%s}{date?fmt=%Y%m%d%H}.dat + +TC_PAIRS_SKIP_IF_OUTPUT_EXISTS = no +TC_PAIRS_READ_ALL_FILES = no +TC_PAIRS_REFORMAT_DECK = no + + +### +# TCPairs +### + +TC_PAIRS_CONFIG_FILE = {PARM_BASE}/met_config/TCPairsConfig_wrapped + +TC_PAIRS_INIT_INCLUDE = TC_PAIRS_INIT_EXCLUDE = -# Specify model init time window in format YYYYMM[DD[_hh]] -# Only tracks that fall within the initialization time window will be used TC_PAIRS_INIT_BEG = TC_PAIRS_INIT_END = @@ -42,58 +57,18 @@ TC_PAIRS_INIT_END = #TC_PAIRS_WRITE_VALID = -# Specify model valid time window in format YYYYMM[DD[_hh]] -# Only tracks that fall within the valid time window will be used TC_PAIRS_VALID_BEG = TC_PAIRS_VALID_END = -# -# Run MET tc_pairs by indicating the top-level directories for the A-deck and B-deck files. Set to 'yes' to -# run using top-level directories, 'no' if you want to run tc_pairs on files paired by the wrapper. -TC_PAIRS_READ_ALL_FILES = no - -# set to true or yes to reformat track data into ATCF format expected by tc_pairs -TC_PAIRS_REFORMAT_DECK = no - -# OVERWRITE OPTIONS -# Don't overwrite filter files if they already exist. -# Set to yes if you do NOT want to override existing files -# Set to no if you do want to override existing files -TC_PAIRS_SKIP_IF_OUTPUT_EXISTS = no - -# Skip looping over forecast leads if a list is provided -#TC_PAIRS_SKIP_LEAD_SEQ = False - - -# -# MET TC-Pairs -# -# List of models to be used (white space or comma separated) eg: DSHP, LGEM, HWRF -# If no models are listed, then process all models in the input file(s). MODEL = MYNN, H19C, H19M, CTRL, MYGF #TC_PAIRS_DESC = -# List of storm ids of interest (space or comma separated) e.g.: AL112012, AL122012 -# If no storm ids are listed, then process all storm ids in the input file(s). -#TC_PAIRS_STORM_ID = ML2092014 #TC_PAIRS_STORM_ID = al062018, al092018, al132018, al142018 - -# Basins (of origin/region). Indicate with space or comma-separated list of regions, eg. AL: for North Atlantic, -# WP: Western North Pacific, CP: Central North Pacific, SH: Southern Hemisphere, IO: North Indian Ocean, LS: Southern -# Hemisphere #TC_PAIRS_BASIN = AL -TC_PAIRS_BASIN = - -# Cyclone, a space or comma-separated list of cyclone numbers. If left empty, all cyclones will be used. TC_PAIRS_CYCLONE = 06 -#TC_PAIRS_CYCLONE = - -# Storm name, a space or comma-separated list of storm names to evaluate. If left empty, all storms will be used. TC_PAIRS_STORM_NAME = -# DLAND file, the full path of the file that contains the gridded representation of the -# minimum distance from land. TC_PAIRS_DLAND_FILE = MET_BASE/tc_data/dland_global_tenth_degree.nc #TC_PAIRS_CONSENSUS1_NAME = @@ -101,20 +76,6 @@ TC_PAIRS_DLAND_FILE = MET_BASE/tc_data/dland_global_tenth_degree.nc #TC_PAIRS_CONSENSUS1_REQUIRED = #TC_PAIRS_CONSENSUS1_MIN_REQ = -# -# DIRECTORIES -# -[dir] -# Location of input track data directory -# for ADECK and BDECK data -TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/met_test/new/hwrf/adeck -TC_PAIRS_EDECK_INPUT_DIR = -TC_PAIRS_BDECK_INPUT_DIR = {INPUT_BASE}/met_test/new/hwrf/bdeck +#TC_PAIRS_CHECK_DUP = -TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs - -[filename_templates] -TC_PAIRS_ADECK_TEMPLATE = {model?fmt=%s}/*{cyclone?fmt=%s}l.{date?fmt=%Y%m%d%H}.trak.hwrf.atcfunix -TC_PAIRS_EDECK_TEMPLATE = -TC_PAIRS_BDECK_TEMPLATE = b{basin?fmt=%s}{cyclone?fmt=%s}{date?fmt=%Y}.dat -TC_PAIRS_OUTPUT_TEMPLATE = tc_pairs_{basin?fmt=%s}{date?fmt=%Y%m%d%H}.dat +#TC_PAIRS_INTERP12 =