From 249f79c6e5d584e60e516b7568d8d23a3ff76dda Mon Sep 17 00:00:00 2001 From: Seth Linden Date: Mon, 12 Jul 2021 15:41:47 -0600 Subject: [PATCH] Per issue #1746 Added some warnings if the forecast threshold is set to NA but the observation threshold is not NA (a numeric threshold) and vice versa. SL --- .../core/wavelet_stat/wavelet_stat_conf_info.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 d66ad25789..b02723de0e 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 @@ -257,7 +257,7 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, // If the forecast threshold array is an empty list (or NA) // Add the NA threshold type to the list for downstream iteration if(fcat_ta[i].n_elements() == 0) { - mlog << Debug(2) << "Found empty list for forecast threshold, setting threshold type to NA.\n"; + mlog << Debug(2) << "Found empty list for forecast threshold, setting threshold type to NA.\n"; fcat_ta[i].add(st_NA); } @@ -268,6 +268,20 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype, 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()) {