From a46794d2288bdbadb75910cdd6a9b6e3d194875b Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Mon, 16 Nov 2020 14:31:32 -0700 Subject: [PATCH] Per #1562, add the same grid_diag fix for the develop branch. --- met/src/libcode/vx_series_data/series_pdf.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/met/src/libcode/vx_series_data/series_pdf.cc b/met/src/libcode/vx_series_data/series_pdf.cc index 8f7eeb0bf6..15f1c8cf15 100644 --- a/met/src/libcode/vx_series_data/series_pdf.cc +++ b/met/src/libcode/vx_series_data/series_pdf.cc @@ -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; @@ -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;