Skip to content

Commit

Permalink
Per #2279, add stubs for actually applying the point_weight_flag sett…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
JohnHalleyGotway committed Oct 10, 2024
1 parent b2ed2a6 commit 0edcd65
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/libcode/vx_statistics/pair_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,16 @@ void PairBase::calc_obs_summary(){

////////////////////////////////////////////////////////////////////////

void PairBase::set_point_weight(const PointWeightType wgt_flag) {

if(!IsPointVx) return;

// JHG work here
return;
}

////////////////////////////////////////////////////////////////////////

void PairBase::add_grid_obs(double o,
const ClimoPntInfo &cpi,
double wgt) {
Expand Down Expand Up @@ -1513,6 +1523,20 @@ void VxPairBase::calc_obs_summary() {

////////////////////////////////////////////////////////////////////////

void VxPairBase::set_point_weight(const PointWeightType wgt_flag) {

if(n_vx == 0) {
mlog << Warning << "\nVxPairBase::set_point_weight() -> "
<< "set_size() has not been called yet!\n\n";
}

for(auto &x : pb_ptr) x->set_point_weight(wgt_flag);

return;
}

////////////////////////////////////////////////////////////////////////

bool VxPairBase::is_keeper_sid(
const char *pnt_obs_str, const char *hdr_sid_str) {
bool keep = true;
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_statistics/pair_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class PairBase {

void calc_obs_summary();

void set_point_weight(const PointWeightType);

};

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -377,6 +379,7 @@ class VxPairBase {

void print_obs_summary() const;
void calc_obs_summary();
void set_point_weight(const PointWeightType);

bool is_keeper_sid(const char *, const char *);
bool is_keeper_var(const char *, const char *, int);
Expand Down
3 changes: 2 additions & 1 deletion src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,11 @@ void process_point_vx() {
// Process each point observation NetCDF file
for(i=0; i<point_obs_file_list.n(); i++) process_point_obs(i);

// Calculate and print observation summaries
// Process observation summaries and point weights
for(i=0; i<conf_info.get_n_vx(); i++) {
conf_info.vx_opt[i].vx_pd.calc_obs_summary();
conf_info.vx_opt[i].vx_pd.print_obs_summary();
conf_info.vx_opt[i].vx_pd.set_point_weight(conf_info.point_weight_flag);
}

// Loop through each of the fields to be verified
Expand Down
3 changes: 2 additions & 1 deletion src/tools/core/point_stat/point_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ int met_main(int argc, char *argv[]) {
process_obs_file(i);
}

// Calculate and print observation summaries
// Process observation summaries and point weights
for(i=0; i<conf_info.get_n_vx(); i++) {
conf_info.vx_opt[i].vx_pd.calc_obs_summary();
conf_info.vx_opt[i].vx_pd.print_obs_summary();
conf_info.vx_opt[i].vx_pd.set_point_weight(conf_info.point_weight_flag);
}

// Compute the scores and write them out
Expand Down

0 comments on commit 0edcd65

Please sign in to comment.