Skip to content

Commit

Permalink
Per #1843, check for divide by zero when computing SI... this could h…
Browse files Browse the repository at this point in the history
…appen if comparing the same input file to itself with Grid-Stat.
  • Loading branch information
JohnHalleyGotway committed Jul 28, 2021
1 parent 71123bc commit 1d849fb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions met/src/libcode/vx_statistics/compute_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ void compute_cntinfo(const SL1L2Info &s, bool aflag, CNTInfo &cnt_info) {
cnt_info.rmse.v = sqrt(cnt_info.mse.v);

// Compute Scatter Index (SI)
cnt_info.si.v = cnt_info.rmse.v / cnt_info.me.v;
if(!is_eq(cnt_info.me.v, 0.0)) {
cnt_info.si.v = cnt_info.rmse.v / cnt_info.me.v;
}
else {
cnt_info.si.v = bad_data_double;
}

// Compute normal confidence intervals
cnt_info.compute_ci();
Expand Down Expand Up @@ -348,7 +353,13 @@ void compute_cntinfo(const PairDataPoint &pd, const NumArray &i_na,
//
// Compute Scatter Index (SI)
//
cnt_info.si.v = cnt_info.rmse.v / cnt_info.me.v;
if(!is_eq(cnt_info.me.v, 0.0)) {
cnt_info.si.v = cnt_info.rmse.v / cnt_info.me.v;
}
else {
cnt_info.si.v = bad_data_double;
}


//
// Only compute the Kendall Tau and Spearman's Rank corrleation
Expand Down

0 comments on commit 1d849fb

Please sign in to comment.