Skip to content

Commit

Permalink
Per issue #1746 Added some warnings if the forecast threshold is set …
Browse files Browse the repository at this point in the history
…to NA but the observation threshold is not NA (a numeric threshold) and vice versa. SL
  • Loading branch information
Seth Linden committed Jul 12, 2021
1 parent 2fae674 commit 249f79c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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()) {

Expand Down

0 comments on commit 249f79c

Please sign in to comment.