Skip to content

Commit

Permalink
Per #1575, make the subset_pairs() utility function a member function…
Browse files Browse the repository at this point in the history
… of the PairDataPoint class named subset_pairs_cnt_thresh() and update the application code to call it.
  • Loading branch information
JohnHalleyGotway committed Mar 30, 2021
1 parent 96076cd commit dac057c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/met_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ void SL1L2Info::set(const PairDataPoint &pd_all) {
zero_out();

// Apply continuous filtering thresholds to subset pairs
pd = subset_pairs(pd_all, fthresh, othresh, logic);
pd = pd_all.subset_pairs_cnt_thresh(fthresh, othresh, logic);

// Check for no matched pairs to process
if(pd.n_obs == 0) return;
Expand Down
4 changes: 2 additions & 2 deletions met/src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ void process_point_scores() {
shc.set_obs_thresh(conf_info.vx_opt[i].othr_ta[m]);

// Subset pairs using the current obs_thresh
pd = pd_ptr->subset_pairs(conf_info.vx_opt[i].othr_ta[m]);
pd = pd_ptr->subset_pairs_obs_thresh(conf_info.vx_opt[i].othr_ta[m]);

// Continue if there are no points
if(pd.n_obs == 0) continue;
Expand Down Expand Up @@ -1779,7 +1779,7 @@ void process_grid_vx() {
shc.set_obs_thresh(conf_info.vx_opt[i].othr_ta[l]);

// Subset pairs using the current obs_thresh
pd = pd_all.subset_pairs(conf_info.vx_opt[i].othr_ta[l]);
pd = pd_all.subset_pairs_obs_thresh(conf_info.vx_opt[i].othr_ta[l]);

// Continue if there are no points
if(pd.n_obs == 0) continue;
Expand Down
12 changes: 10 additions & 2 deletions met/src/tools/core/grid_stat/grid_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
// continuous and probabilistic statistics.
// 050 03/02/20 Halley Gotway Add nc_pairs_var_name and rename
// nc_pairs_var_str to nc_pairs_var_suffix.
// 051 03/28/21 Halley Gotway Add mpr_column and mpr_thresh
// filtering options.
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -1829,6 +1831,11 @@ void get_mask_points(const GridStatVxOpt &vx_opt,

if(cmn_ptr && csd_ptr) pd.add_climo_cdf();

// Apply any MPR filters
if(vx_opt.mpr_sa.n() > 0) {
pd = pd.subset_pairs_mpr_thresh(vx_opt.mpr_sa, vx_opt.mpr_ta);
}

return;
}

Expand Down Expand Up @@ -1961,8 +1968,9 @@ void do_cnt_sl1l2(const GridStatVxOpt &vx_opt, const PairDataPoint *pd_ptr) {
for(i=0; i<vx_opt.fcnt_ta.n(); i++) {

// Apply continuous filtering thresholds to subset pairs
pd_thr = subset_pairs(*pd_ptr, vx_opt.fcnt_ta[i],
vx_opt.ocnt_ta[i], vx_opt.cnt_logic);
pd_thr = pd_ptr->subset_pairs_cnt_thresh(vx_opt.fcnt_ta[i],
vx_opt.ocnt_ta[i],
vx_opt.cnt_logic);

// Check for no matched pairs to process
if(pd_thr.n_obs == 0) continue;
Expand Down
4 changes: 2 additions & 2 deletions met/src/tools/core/series_analysis/series_analysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ void do_cnt(int n, const PairDataPoint *pd_ptr) {
}

// Apply continuous filtering thresholds to subset pairs
pd = subset_pairs(*pd_ptr, cnt_info.fthresh, cnt_info.othresh,
cnt_info.logic);
pd = pd_ptr->subset_pairs_cnt_thresh(cnt_info.fthresh, cnt_info.othresh,
cnt_info.logic);

// Check for no matched pairs to process
if(pd.n_obs == 0) continue;
Expand Down

0 comments on commit dac057c

Please sign in to comment.