From c789a22b887fe26a5126bf5f8a57e66330a097ec Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Mon, 24 Jun 2024 14:30:52 -0600 Subject: [PATCH] Per #2880, remove quality_mark_thresh and add obs_quality_inc and obs_quality_exc. --- src/tools/other/point2grid/point2grid.cc | 3 +-- .../other/point2grid/point2grid_conf_info.cc | 18 ++++++------------ .../other/point2grid/point2grid_conf_info.h | 3 ++- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/tools/other/point2grid/point2grid.cc b/src/tools/other/point2grid/point2grid.cc index 2b067ffdf4..71136db8ff 100644 --- a/src/tools/other/point2grid/point2grid.cc +++ b/src/tools/other/point2grid/point2grid.cc @@ -22,10 +22,10 @@ // 002 07-06-22 Howard Soh METplus-Internal #19 Rename main to met_main // 003 10-03-23 Prestopnik MET #2227 Remove namespace std and netCDF from header files // 004 05-20-24 Howard Soh MET #2867 Fix -qc ADP bug. +// 004 06-24-24 Halley Gotway MET #2880 Filter obs_quality. // //////////////////////////////////////////////////////////////////////// - #include #include #include @@ -54,7 +54,6 @@ using namespace std; using namespace netCDF; - //////////////////////////////////////////////////////////////////////// static ConcatString program_name; diff --git a/src/tools/other/point2grid/point2grid_conf_info.cc b/src/tools/other/point2grid/point2grid_conf_info.cc index ad661ebfe8..9ccc255a73 100644 --- a/src/tools/other/point2grid/point2grid_conf_info.cc +++ b/src/tools/other/point2grid/point2grid_conf_info.cc @@ -8,13 +8,11 @@ //////////////////////////////////////////////////////////////////////// - #include "point2grid_conf_info.h" #include "vx_log.h" using namespace std; - //////////////////////////////////////////////////////////////////////// // // Code for class PointToGridConfInfo @@ -49,7 +47,8 @@ void PointToGridConfInfo::clear() { // Initialize values message_type.clear(); beg_ds = end_ds = bad_data_int; - quality_mark_thresh = bad_data_int; + obs_qty_inc.clear(); + obs_qty_exc.clear(); version.clear(); valid_time = 0; def_var_name_map.clear(); @@ -110,16 +109,11 @@ void PointToGridConfInfo::process_config() { // Conf: var_name_map var_name_map = parse_conf_key_value_map(&conf, conf_key_var_name_map); - // Conf: quality_mark_thresh - quality_mark_thresh = conf.lookup_int(conf_key_quality_mark_thresh); + // Conf: obs_quality_inc + obs_quality_inc = parse_conf_obs_qty_inc(&conf); - // Check the value - if(quality_mark_thresh < 0 || quality_mark_thresh > 15) { - mlog << Warning << "\nPointToGridConfInfo::process_config() -> " - << "the \"" << conf_key_quality_mark_thresh - << "\" entry (" << quality_mark_thresh - << ") should be set between 0 and 15.\n\n"; - } + // Conf: obs_quality_exc + obs_quality_exc = parse_conf_obs_qty_exc(&conf); return; } diff --git a/src/tools/other/point2grid/point2grid_conf_info.h b/src/tools/other/point2grid/point2grid_conf_info.h index 5b12b6166e..725099b89c 100644 --- a/src/tools/other/point2grid/point2grid_conf_info.h +++ b/src/tools/other/point2grid/point2grid_conf_info.h @@ -42,7 +42,8 @@ class PointToGridConfInfo { unixtime valid_time; // valid time int beg_ds; // Time range of observations to be retained, int end_ds; // Defined relative to the PrepBufr center time (seconds) - int quality_mark_thresh; // Quality marks to be retained + StringArray obs_qty_inc; // Quality mark strings to be included + StringArray obs_qty_exc; // Quality mark strings to be excluded ConcatString version; // Config file version PointToGridConfInfo();