Skip to content

Commit

Permalink
Per #2880, not working quite right yet but this is progress
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Sep 20, 2024
1 parent e95cc01 commit deddf97
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/libcode/vx_nc_obs/met_point_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void MetPointObsData::assign(MetPointObsData &o) {
}
}
var_names = o.var_names;
qty_names = o.var_names;
qty_names = o.qty_names;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -338,6 +338,12 @@ float MetPointObsData::get_obs_val(int index) {

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

string MetPointObsData::get_obs_qty(int index) {
return qty_names[(obs_qids[index])];
}

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

// struct MetPointHeader

MetPointHeader::MetPointHeader()
Expand Down
1 change: 1 addition & 0 deletions src/libcode/vx_nc_obs/met_point_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct MetPointObsData {
void clear_strings();
bool fill_obs_buf(int buf_size, int offset, float *obs_arr, int *qty_idx_arr);
float get_obs_val(int index);
std::string get_obs_qty(int index);
};


Expand Down
11 changes: 10 additions & 1 deletion src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,21 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI
continue;
}

// Filter by QC flag
// Filter by QC flag (-qc command line option)
if (has_qc_flags && !qc_idx_array.has(obs_data->obs_qids[idx])) {
filtered_by_qc++;
continue;
}

// Filter by QC inclusion/exclusion lists (obs_quality_inc/exc config option)
if ((conf_info.obs_qty_inc.n() > 0 &&
!conf_info.obs_qty_inc.has(obs_data->get_obs_qty(idx))) ||
(conf_info.obs_qty_exc.n() > 0 &&
conf_info.obs_qty_exc.has(obs_data->get_obs_qty(idx)))) {
filtered_by_qc++;
continue;
}

var_index_array.add(idx);
var_count++;
if (is_eq(obs_data->obs_vals[idx], (float)0.)) obs_count_zero_from++;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/other/point2grid/point2grid_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ void PointToGridConfInfo::process_config() {
var_name_map = parse_conf_key_value_map(&conf, conf_key_var_name_map);

// Conf: obs_quality_inc
obs_quality_inc = parse_conf_obs_qty_inc(&conf);
obs_qty_inc = parse_conf_obs_qty_inc(&conf);

// Conf: obs_quality_exc
obs_quality_exc = parse_conf_obs_qty_exc(&conf);
obs_qty_exc = parse_conf_obs_qty_exc(&conf);

return;
}
Expand Down

0 comments on commit deddf97

Please sign in to comment.