From abd2a34df167bbca0bd8c280e34234732dd76da5 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Thu, 15 Jul 2021 10:45:17 -0600 Subject: [PATCH] Per #1746, loop over each pair of fcst/obs thresholds to check for inconsistent use of the NA threshold type. --- .../wavelet_stat/wavelet_stat_conf_info.cc | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc b/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc index b02723de0e..77bd56616e 100644 --- a/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc +++ b/met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc @@ -135,7 +135,7 @@ void WaveletStatConfInfo::read_config(const char *default_file_name, void WaveletStatConfInfo::process_config(GrdFileType ftype, GrdFileType otype) { - int i, n; + int i, j, n; VarInfoFactory info_factory; mapoutput_map; Dictionary *fcst_dict = (Dictionary *) 0; @@ -267,24 +267,9 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, mlog << Debug(2) << "Found empty list for observation threshold, setting threshold type to NA.\n"; ocat_ta[i].add(st_NA); } - - // Send a warning if forecast threshold is NA but observation threshold is not - if( (strcmp((fcat_ta[i].get_str()).c_str(), "NA") == 0) && - (strcmp((ocat_ta[i].get_str()).c_str(), "NA") != 0) ) { - mlog << Warning << "The forecast threshold is set to NA but the observation threshold is " << ocat_ta[i].get_str() << "...\n"; - mlog << Warning << "if you are getting unexpected results change the forecast threshold to a numeric threshold.\n"; - } - // Send a warning if observation threshold is NA but forecast threshold is not - if( (strcmp((ocat_ta[i].get_str()).c_str(), "NA") == 0) && - (strcmp((fcat_ta[i].get_str()).c_str(), "NA") != 0) ) { - mlog << Warning << "The observation threshold is set to NA but the forecast threshold is " << fcat_ta[i].get_str() << "...\n"; - mlog << Warning << "if you are getting unexpected results change the observation threshold to a numeric threshold.\n"; - } - // Check for the same number of fcst and obs thresholds if(fcat_ta[i].n_elements() != ocat_ta[i].n_elements()) { - mlog << Error << "\nWaveletStatConfInfo::process_config() -> " << "The number of thresholds for each field in \"fcst." << conf_key_cat_thresh @@ -293,6 +278,17 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, exit(1); } + // Send a warning about inconsistent use of the NA threshold + for(j=0; j " + << "Skipping thresholding for either the forecast (" + << fcat_ta[i][j].get_str() << ") or observation (" << ocat_ta[i][j].get_str() + << ") but not the other. This may produce unexpected results!\n\n"; + } + } + // Keep track of the maximum number of thresholds if(fcat_ta[i].n_elements() > max_n_thresh) max_n_thresh = fcat_ta[i].n_elements();