Skip to content

Commit

Permalink
Per #2786, call rescale_probability() function to convert from 0-100 …
Browse files Browse the repository at this point in the history
…probs to 0-1 probs.
  • Loading branch information
JohnHalleyGotway committed Apr 17, 2024
1 parent 55f3401 commit 86b1aa3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ bool get_data_plane(const char *infile, GrdFileType ftype,
dp = met_regrid(dp, mtddf->grid(), grid, info->regrid());
}

// Rescale probabilities from [0, 100] to [0, 1]
if(info->is_prob()) rescale_probability(dp);

// Store the valid time, if not already set
if(ens_valid_ut == (unixtime) 0) {
ens_valid_ut = dp.valid();
Expand Down Expand Up @@ -725,6 +728,13 @@ bool get_data_plane_array(const char *infile, GrdFileType ftype,
}
}

// Rescale probabilities from [0, 100] to [0, 1]
if(info->is_prob()) {
for(i=0; i<dpa.n_planes(); i++) {
rescale_probability(dpa[i]);
}
} // end for i

// Store the valid time, if not already set
if(ens_valid_ut == (unixtime) 0) {
ens_valid_ut = dpa[0].valid();
Expand Down

0 comments on commit 86b1aa3

Please sign in to comment.