Skip to content

Commit

Permalink
Bugfix 1562 develop grid_diag (#1564)
Browse files Browse the repository at this point in the history
* Per #1562, add the same grid_diag fix for the develop branch.

* Per #1562, removing the poly = CONUS.poly mask from GridDiagConfig_TMP. That settting masked a problem in the handling of missing data. Exercising the mask.poly option is tested in another unit test. This will change the output and break the nightly build, but that's good since we'll do more thorough testing.
  • Loading branch information
JohnHalleyGotway authored Nov 16, 2020
1 parent cbf10e6 commit f2498bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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
2 changes: 1 addition & 1 deletion test/config/GridDiagConfig_TMP
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ data = {

mask = {
grid = "";
poly = "MET_BASE/poly/CONUS.poly";
poly = "";
}

////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit f2498bf

Please sign in to comment.