Skip to content

Commit

Permalink
Per #1746, need to reinitialize apply_fcst_thresh and apply_obs_thres…
Browse files Browse the repository at this point in the history
…h to true inside the loop since the NA threshold can appear anywhere in the list of thresholds.
  • Loading branch information
JohnHalleyGotway committed Jul 15, 2021
1 parent 8650b74 commit fb1a109
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions met/src/tools/core/wavelet_stat/wavelet_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,8 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na,
int bnd, row, col;
int i, j, k;
ConcatString fcst_thresh_str, obs_thresh_str;
bool apply_fcst_thresh, apply_obs_thresh;

int apply_fcst_thresh = 1;
int apply_obs_thresh = 1;

// Check the NumArray lengths
n = f_na.n();
if(n != o_na.n()) {
Expand Down Expand Up @@ -997,19 +995,22 @@ void do_intensity_scale(const NumArray &f_na, const NumArray &o_na,
// Apply each threshold
for(i=0; i<conf_info.fcat_ta[i_vx].n(); i++) {

// Initialize to true
apply_fcst_thresh = apply_obs_thresh = true;

fcst_thresh_str = isc_info[i].fthresh.get_abbr_str();
obs_thresh_str = isc_info[i].othresh.get_abbr_str();

// If the forecast threshold is set to NA skip masking below
if(isc_info[i].fthresh.get_type() == thresh_na) {
mlog << Debug(2) << "The forecast threshold is NA (missing), skipping applying threshold.\n";
apply_fcst_thresh = 0;
mlog << Debug(2) << "The forecast threshold is NA, skipping applying threshold.\n";
apply_fcst_thresh = false;
}

// If the observation threshold is set to NA skip masking below
if(isc_info[i].othresh.get_type() == thresh_na) {
mlog << Debug(2) << "The observation threshold is NA (missing), skipping applying threshold.\n";
apply_obs_thresh = 0;
mlog << Debug(2) << "The observation threshold is NA, skipping applying threshold.\n";
apply_obs_thresh = false;
}

mlog << Debug(2) << "Computing Intensity-Scale decomposition for "
Expand Down
6 changes: 3 additions & 3 deletions met/src/tools/core/wavelet_stat/wavelet_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ void WaveletStatConfInfo::process_config(GrdFileType ftype,
if((fcat_ta[i][j].get_type() == thresh_na) !=
(ocat_ta[i][j].get_type() == thresh_na)) {
mlog << Warning << "\nWaveletStatConfInfo::process_config() -> "
<< "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";
<< "Skipping thresholding for the forecast (" << fcat_ta[i][j].get_str()
<< ") or observation (" << ocat_ta[i][j].get_str()
<< ") but not the other may produce unexpected results!\n\n";
}
}

Expand Down

0 comments on commit fb1a109

Please sign in to comment.