diff --git a/src/basic/vx_config/config_constants.h b/src/basic/vx_config/config_constants.h index ee2b37927..686e3dd52 100644 --- a/src/basic/vx_config/config_constants.h +++ b/src/basic/vx_config/config_constants.h @@ -609,6 +609,8 @@ static const char conf_key_censor_thresh[] = "censor_thresh"; static const char conf_key_censor_val[] = "censor_val"; static const char conf_key_mpr_column[] = "mpr_column"; static const char conf_key_mpr_thresh[] = "mpr_thresh"; +static const char conf_key_mpr_str_inc[] = "mpr_str_inc"; +static const char conf_key_mpr_str_exc[] = "mpr_str_exc"; static const char conf_key_cnt_thresh[] = "cnt_thresh"; static const char conf_key_cnt_logic[] = "cnt_logic"; static const char conf_key_cat_thresh[] = "cat_thresh"; diff --git a/src/libcode/vx_statistics/pair_base.cc b/src/libcode/vx_statistics/pair_base.cc index 4f07b8736..75a8d1a19 100644 --- a/src/libcode/vx_statistics/pair_base.cc +++ b/src/libcode/vx_statistics/pair_base.cc @@ -1436,7 +1436,7 @@ void VxPairBase::set_interp(int i_interp, //////////////////////////////////////////////////////////////////////// -void VxPairBase::set_mpr_thr_inc_map(const map &m) { +void VxPairBase::set_mpr_thr_inc_map(const map &m) { mpr_thr_inc_map = m; @@ -1445,7 +1445,7 @@ void VxPairBase::set_mpr_thr_inc_map(const map &m) { //////////////////////////////////////////////////////////////////////// -void VxPairBase::set_mpr_str_inc_map(const map &m) { +void VxPairBase::set_mpr_str_inc_map(const map &m) { mpr_str_inc_map = m; @@ -1454,7 +1454,7 @@ void VxPairBase::set_mpr_str_inc_map(const map &m) { //////////////////////////////////////////////////////////////////////// -void VxPairBase::set_mpr_str_exc_map(const map &m) { +void VxPairBase::set_mpr_str_exc_map(const map &m) { mpr_str_exc_map = m; diff --git a/src/libcode/vx_statistics/pair_base.h b/src/libcode/vx_statistics/pair_base.h index 4da5c29a5..62e5ec5c0 100644 --- a/src/libcode/vx_statistics/pair_base.h +++ b/src/libcode/vx_statistics/pair_base.h @@ -288,12 +288,12 @@ class VxPairBase { // Mapping of numeric MPR columns or diffs of colums to // inclusion thresholds - std::map mpr_thr_inc_map; + std::map mpr_thr_inc_map; // Mapping of string MPR columns to list of inclusion // and exclusion strings - std::map mpr_str_inc_map; - std::map mpr_str_exc_map; + std::map mpr_str_inc_map; + std::map mpr_str_exc_map; ////////////////////////////////////////////////////////////////// @@ -385,9 +385,9 @@ class VxPairBase { void set_interp(int i_interp, InterpMthd mthd, int width, GridTemplateFactory::GridTemplates shape); - void set_mpr_thr_inc_map(const std::map &); - void set_mpr_str_inc_map(const std::map &); - void set_mpr_str_exc_map(const std::map &); + void set_mpr_thr_inc_map(const std::map &); + void set_mpr_str_inc_map(const std::map &); + void set_mpr_str_exc_map(const std::map &); void set_climo_cdf_info_ptr(const ClimoCDFInfo *); diff --git a/src/libcode/vx_statistics/pair_data_point.cc b/src/libcode/vx_statistics/pair_data_point.cc index d34b65798..b3144c768 100644 --- a/src/libcode/vx_statistics/pair_data_point.cc +++ b/src/libcode/vx_statistics/pair_data_point.cc @@ -742,7 +742,7 @@ bool check_fo_thresh(double f, double o, const ClimoPntInfo &cpi, //////////////////////////////////////////////////////////////////////// bool check_mpr_thresh(double f, double o, const ClimoPntInfo &cpi, - const map &m, + const map &m, ConcatString *reason_ptr) { // Initialize if(reason_ptr) reason_ptr->erase(); @@ -846,7 +846,7 @@ double get_mpr_column_value(double f, double o, const ClimoPntInfo &cpi, void apply_mpr_thresh_mask(DataPlane &fcst_dp, DataPlane &obs_dp, DataPlane &fcmn_dp, DataPlane &fcsd_dp, DataPlane &ocmn_dp, DataPlane &ocsd_dp, - const map &m) { + const map &m) { // Check for no work to be done if(m.size() == 0) return; diff --git a/src/libcode/vx_statistics/pair_data_point.h b/src/libcode/vx_statistics/pair_data_point.h index 57084675d..aa0e13520 100644 --- a/src/libcode/vx_statistics/pair_data_point.h +++ b/src/libcode/vx_statistics/pair_data_point.h @@ -141,7 +141,7 @@ extern bool check_fo_thresh(double, double, const ClimoPntInfo &, const SetLogic); extern bool check_mpr_thresh(double, double, const ClimoPntInfo &, - const std::map &, + const std::map &, ConcatString * = 0); extern double get_mpr_column_value(double, double, const ClimoPntInfo &, @@ -150,7 +150,7 @@ extern double get_mpr_column_value(double, double, const ClimoPntInfo &, extern void apply_mpr_thresh_mask(DataPlane &, DataPlane &, DataPlane &, DataPlane &, DataPlane &, DataPlane &, - const std::map &); + const std::map &); extern bool check_seeps_thresh(double, double, const StringArray &, const ThreshArray &, diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.h b/src/tools/core/grid_stat/grid_stat_conf_info.h index c46eef12a..8319bbb6d 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.h +++ b/src/tools/core/grid_stat/grid_stat_conf_info.h @@ -150,7 +150,7 @@ class GridStatVxOpt { // nc_pairs_var_str is deprecated // Matched pair inclusion thresholds - std::map mpr_thr_inc_map; + std::map mpr_thr_inc_map; ThreshArray fcat_ta; // fcst categorical thresholds ThreshArray ocat_ta; // obs categorical thresholds diff --git a/src/tools/core/pair_stat/pair_stat_conf_info.cc b/src/tools/core/pair_stat/pair_stat_conf_info.cc index 0d093dac6..20819793d 100644 --- a/src/tools/core/pair_stat/pair_stat_conf_info.cc +++ b/src/tools/core/pair_stat/pair_stat_conf_info.cc @@ -693,6 +693,8 @@ void PairStatVxOpt::clear() { mask_llpnt.clear(); mpr_thr_inc_map.clear(); + mpr_str_inc_map.clear(); + mpr_str_exc_map.clear(); mask_name.clear(); @@ -763,6 +765,7 @@ void PairStatVxOpt::process_config(PairsFormat ftype, VarInfoFactory info_factory; mapoutput_map; Dictionary *dict; + const char *method_name = "PairStatVxOpt::process_config() -> "; // Initialize clear(); @@ -788,14 +791,14 @@ void PairStatVxOpt::process_config(PairsFormat ftype, // No support for wind direction if(vx_pd.fcst_info->is_wind_direction() || vx_pd.obs_info->is_wind_direction()) { - mlog << Error << "\nPairStatVxOpt::process_config() -> " + mlog << Error << "\n" << method_name << "wind direction may not be verified using pair_stat.\n\n"; exit(1); } // Check that the observation field does not contain probabilities if(vx_pd.obs_info->is_prob()) { - mlog << Error << "\nPairStatVxOpt::process_config() -> " + mlog << Error << "\n" << method_name << "the observation field cannot contain probabilities.\n\n"; exit(1); } @@ -842,7 +845,7 @@ void PairStatVxOpt::process_config(PairsFormat ftype, // Check for the same length if(mpr_sa.n() != mpr_ta.n()) { - mlog << Error << "\nPairStatVxOpt::process_config() -> " + mlog << Error << "\n" << method_name << "The length of \"" << conf_key_mpr_column << "\" and \"" << conf_key_mpr_thresh << "\" must match (" << mpr_sa.n() << " != " << mpr_ta.n() << ")!\n\n"; @@ -858,6 +861,14 @@ void PairStatVxOpt::process_config(PairsFormat ftype, mpr_thr_inc_map[(mpr_sa[i])].add(mpr_ta[i]); } + // Conf: mpr_str_inc + parse_add_conf_key_values_map(&odict, conf_key_mpr_str_inc, + &mpr_str_inc_map, method_name); + + // Conf: mpr_str_exc + parse_add_conf_key_values_map(&odict, conf_key_mpr_str_exc, + &mpr_str_exc_map, method_name); + // Dump the contents of the current thresholds if(mlog.verbosity_level() >= 5) { mlog << Debug(5) @@ -883,7 +894,7 @@ void PairStatVxOpt::process_config(PairsFormat ftype, if(!vx_pd.fcst_info->is_prob() && fcat_ta.n() != ocat_ta.n()) { - mlog << Error << "\nPairStatVxOpt::process_config() -> " + mlog << Error << "\n" << method_name << "The number of thresholds for each field in \"fcst." << conf_key_cat_thresh << "\" must match the number of thresholds for each " @@ -986,8 +997,10 @@ void PairStatVxOpt::set_vx_pd(PairStatConfInfo *conf_info) { // Define the dimensions with n_msg_typ = n_interp = 1 vx_pd.set_size(1, n_mask, 1); - // Store the MPR filtering thresholds + // Store the MPR filtering maps vx_pd.set_mpr_thr_inc_map(mpr_thr_inc_map); + vx_pd.set_mpr_str_inc_map(mpr_str_inc_map); + vx_pd.set_mpr_str_exc_map(mpr_str_exc_map); // Store the climo CDF info vx_pd.set_climo_cdf_info_ptr(&cdf_info); diff --git a/src/tools/core/pair_stat/pair_stat_conf_info.h b/src/tools/core/pair_stat/pair_stat_conf_info.h index dd5dd72da..e35538d8f 100644 --- a/src/tools/core/pair_stat/pair_stat_conf_info.h +++ b/src/tools/core/pair_stat/pair_stat_conf_info.h @@ -143,7 +143,11 @@ class PairStatVxOpt { StringArray mask_sid; // Masking station ID's // Matched pair inclusion thresholds - std::map mpr_thr_inc_map; + std::map mpr_thr_inc_map; + + // Matched pair inclusion and exclusion strings + std::map mpr_str_inc_map; + std::map mpr_str_exc_map; // Vector of MaskLatLon objects defining Lat/Lon Point masks std::vector mask_llpnt; diff --git a/src/tools/core/point_stat/point_stat_conf_info.h b/src/tools/core/point_stat/point_stat_conf_info.h index 3660cb78d..732a3fd4e 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.h +++ b/src/tools/core/point_stat/point_stat_conf_info.h @@ -130,7 +130,7 @@ class PointStatVxOpt { StringArray mask_sid; // Masking station ID's // Matched pair inclusion thresholds - std::map mpr_thr_inc_map; + std::map mpr_thr_inc_map; // Vector of MaskLatLon objects defining Lat/Lon Point masks std::vector mask_llpnt;