Skip to content

Commit

Permalink
Per #1562, add the same grid_diag fix for the develop branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Nov 16, 2020
1 parent cbf10e6 commit a46794d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions met/src/libcode/vx_series_data/series_pdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ void update_pdf(

for(int i = 0; i < dp.nx(); i++) {
for(int j = 0; j < dp.ny(); j++) {
if(!mp.s_is_on(i, j)) continue;
double value = dp.get(i, j);
if(!mp.s_is_on(i, j) ||
is_bad_data(value)) continue;
int k = floor((value - min) / delta);
if(k < 0) k = 0;
if(k >= pdf.size()) k = pdf.size() - 1;
Expand All @@ -92,12 +93,14 @@ void update_joint_pdf(

for(int i = 0; i < dp_A.nx(); i++) {
for(int j = 0; j < dp_A.ny(); j++) {
if(!mp.s_is_on(i, j)) continue;
double value_A = dp_A.get(i, j);
double value_B = dp_B.get(i, j);
if(!mp.s_is_on(i, j) ||
is_bad_data(value_A) ||
is_bad_data(value_B)) continue;
int k_A = floor((value_A - min_A) / delta_A);
if(k_A < 0) k_A = 0;
if(k_A >= n_A) k_A = n_A - 1;
double value_B = dp_B.get(i, j);
int k_B = floor((value_B - min_B) / delta_B);
if(k_B < 0) k_B = 0;
if(k_B >= n_B) k_B = n_B - 1;
Expand Down

0 comments on commit a46794d

Please sign in to comment.