Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 1858 obs quality #1919

Merged
merged 45 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
12dc91a
Per issue #1858: changed parse_conf_obs_qty to parse_conf_obs_qty_inc…
Aug 30, 2021
4b72fb9
Per issue #1858: changed conf_key_obs_qty to conf_key_obs_qty_inc. Ad…
Aug 30, 2021
4a2f3b2
Per issue #1858: modified vx_pd.set_obs_qty_filt() to use parse_conf_…
Aug 30, 2021
e0a4a48
Per issue #1858: added back the original parse_conf_obs_qty() functio…
Aug 31, 2021
3256a2c
Per issue #1858: added back config_constants.h for backwards compatib…
Aug 31, 2021
1abc2ef
Per issue #1858: added code to read in obs_qty_inc instead of obs_qty…
Aug 31, 2021
f82966e
Changed obs_qty_filt to obs_qty_inc_filt. Added obs_qty_exc_filt, inc…
Sep 8, 2021
9c9d11c
Per issue #1858 added vx_pd.set_obs_qty_exc_filt. SL
Sep 8, 2021
f7f76ca
In add_point_obs() added if block to apply obs_qty_exc_filt. SL
Sep 8, 2021
d7555e8
Per issue #1858, committig latest version. Added some debug cout stat…
Sep 9, 2021
787e677
Per issue #1858, in add_point_obs(), cleaned up sections that apply o…
Sep 9, 2021
94e2287
Per issue #1858 in process_config(), cleaned up sections that set obs…
Sep 9, 2021
c65c180
Per issue #1858 in process_obs_file() cleaned up code. SL
Sep 9, 2021
9274578
Per issue #1858: changed obs_qty_filt to obs_qty_inc_filt. Added obs_…
Sep 10, 2021
8f624dd
Per issue #1858: in process_config(): added code to set_obs_qty_inc_f…
Sep 10, 2021
69e3b91
Per issue #1858: in add_point_obs() modified section that applies the…
Sep 10, 2021
a914a4c
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 10, 2021
8554dec
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 10, 2021
206a8b9
Per issue #1858: For both the point_stat and ensemble_stat tests: mod…
Sep 13, 2021
ea0154e
Per issue #1858: just added comment at top of file indicating what ch…
Sep 13, 2021
06b99d1
Per issue #1858: just added comment at top of file indicating what ch…
Sep 13, 2021
ae15242
Per issue #1858: removed parse_conf_obs_qty. Modified parse_conf_obs_…
Sep 14, 2021
a28087f
Per issue #1858: in process_config(), modified section that calls set…
Sep 14, 2021
ab012d6
Modified parse_conf_obs_qty_inc and parse_conf_obs_qty_exc. SL
Sep 14, 2021
654754d
Per issue #1858: re-updated parse_conf_obs_qty_exc and reverted back …
Sep 14, 2021
f4b54ad
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 14, 2021
ec4631d
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 14, 2021
3a826b4
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 14, 2021
ff82a7b
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 14, 2021
a8c3be7
Per issue #1858: replaced obs_quality with obs_quality_inc and added …
Sep 14, 2021
fc743fb
Per issue #1858: replaced obs_quality with obs_quality_inc. Added doc…
Sep 14, 2021
60c8878
Per issue #1858: checking in latest version. Modified section that ca…
Sep 15, 2021
f24e1d5
Per issue #1858: cleaned up some extra line spaces. SL
Sep 15, 2021
dbb755c
Per #1858, removed the deprecated obs_quality configuration entry fro…
JohnHalleyGotway Sep 15, 2021
98c5657
Per issue #1858: duplicated fcst/obs fields to run/test with both obs…
Sep 15, 2021
116f874
Per issue #1858: duplicated fcst/obs fields to run/test with both obs…
Sep 15, 2021
351af7c
Per issue #1858. Deleted these files git repository. These were repla…
Sep 15, 2021
20f3635
Per issue #1858. Deleted these files from the git repository. These w…
Sep 15, 2021
57b59bf
Per issue #1858. Deleted these files from the git repository. These w…
Sep 15, 2021
a499caf
Per issue #1858: Modified: Don't need to run separate tests for obs_q…
Sep 15, 2021
31e98f2
Per #1858, update the logic in parse_conf_obs_qty_inc() to use last_l…
JohnHalleyGotway Sep 15, 2021
0474eda
Merge branch 'feature_1858_obs_quality' of https://github.com/dtcente…
JohnHalleyGotway Sep 15, 2021
5a3bd3d
Per #1858, tweak the warning message.
JohnHalleyGotway Sep 15, 2021
cd21f90
Per #1858, made the existing unit_quality_filter.xml tests a bit more…
Sep 15, 2021
0427092
Per #1858, remove the _ON from the job name since the _OFF has been i…
Sep 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion met/data/config/EnsembleStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ message_type = [ "ADPUPA" ];
sid_inc = [];
sid_exc = [];
obs_thresh = [ NA ];
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
duplicate_flag = NONE;
obs_summary = NONE;
obs_perc_value = 50;
Expand Down
3 changes: 2 additions & 1 deletion met/data/config/PointStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ obs = fcst;
message_type = [ "ADPUPA" ];
sid_inc = [];
sid_exc = [];
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
duplicate_flag = NONE;
obs_summary = NONE;
obs_perc_value = 50;
Expand Down
25 changes: 21 additions & 4 deletions met/docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1997,20 +1997,37 @@ Percentile value to use when obs_summary = PERC
obs_perc_value = 50;


.. _obs_quality:
.. _obs_quality_inc:

:ref:`obs_quality <obs_quality>`
:ref:`obs_quality_inc <obs_quality_inc>`

The "obs_quality" entry specifies the quality flag values that are to be
The "obs_quality_inc" entry specifies the quality flag values that are to be
retained and used for verification. An empty list signifies that all
point observations should be used, regardless of their quality flag value.
The quality flag values will vary depending on the original source of the
observations. The quality flag values to retain should be specified as
an array of strings, even if the values themselves are numeric.
Note "obs_quality_inc" replaces the older option "obs_quality".

.. code-block:: none

obs_quality = [ "1", "2", "3", "9" ];
obs_quality_inc = [ "1", "2", "3", "9" ];


.. _obs_quality_exc:

:ref:`obs_quality_exc <obs_quality_exc>`

The "obs_quality_exc" entry specifies the quality flag values that are to be
ignored and not used for verification. An empty list signifies that all
point observations should be used, regardless of their quality flag value.
The quality flag values will vary depending on the original source of the
observations. The quality flag values to ignore should be specified as
an array of strings, even if the values themselves are numeric.

.. code-block:: none

obs_quality_exc = [ "1", "2", "3", "9" ];


.. _met_data_dir:
Expand Down
3 changes: 2 additions & 1 deletion met/docs/Users_Guide/ensemble-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ ____________________
sid_inc = [];
sid_exc = [];
duplicate_flag = NONE;
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
obs_summary = NONE;
obs_perc_value = 50;
message_type_group_map = [...];
Expand Down
3 changes: 2 additions & 1 deletion met/docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ ________________________
sid_inc = [];
sid_exc = [];
duplicate_flag = NONE;
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
obs_summary = NONE;
obs_perc_value = 50;
message_type_group_map = [...];
Expand Down
3 changes: 2 additions & 1 deletion met/scripts/config/EnsembleStatConfig
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ obs = fcst;
sid_inc = [];
sid_exc = [];
obs_thresh = [ NA ];
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
duplicate_flag = NONE;
obs_summary = NONE;
obs_perc_value = 50;
Expand Down
3 changes: 2 additions & 1 deletion met/scripts/config/PointStatConfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ obs = fcst;
//
sid_inc = [];
sid_exc = [];
obs_quality = [];
obs_quality_inc = [];
obs_quality_exc = [];
duplicate_flag = NONE;
obs_summary = NONE;
obs_percentile = 50;
Expand Down
2 changes: 2 additions & 0 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ static const char conf_key_message_type[] = "message_type";
static const char conf_key_sid_inc[] = "sid_inc";
static const char conf_key_sid_exc[] = "sid_exc";
static const char conf_key_obs_qty[] = "obs_quality";
static const char conf_key_obs_qty_inc[] = "obs_quality_inc";
static const char conf_key_obs_qty_exc[] = "obs_quality_exc";
static const char conf_key_convert[] = "convert";
static const char conf_key_censor_thresh[] = "censor_thresh";
static const char conf_key_censor_val[] = "censor_val";
Expand Down
31 changes: 28 additions & 3 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,36 @@ vector<MaskLatLon> parse_conf_llpnt_mask(Dictionary *dict) {

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

StringArray parse_conf_obs_qty(Dictionary *dict) {
const char *method_name = "parse_conf_obs_qty() -> ";
StringArray parse_conf_obs_qty_inc(Dictionary *dict) {
StringArray sa;
const char *method_name = "parse_conf_obs_qty_inc() -> ";

// Check for old "obs_quality" entry
sa = dict->lookup_string_array(conf_key_obs_qty, false);

StringArray sa = parse_conf_string_array(dict, conf_key_obs_qty, method_name);
// Print a warning if the deprecated option was used
if(dict->last_lookup_status()) {
mlog << Warning << "\nparse_conf_obs_qty_inc() -> "
<< "Set the \"" << conf_key_obs_qty_inc << "\" value ("
<< write_css(sa) << ") from the deprecated \""
<< conf_key_obs_qty << "\" configuration entry.\n"
<< "Replace \"" << conf_key_obs_qty << "\" with \""
<< conf_key_obs_qty_inc << "\"!\n\n";
}
else {
sa = parse_conf_string_array(dict, conf_key_obs_qty_inc, method_name);
}

return(sa);
}

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

StringArray parse_conf_obs_qty_exc(Dictionary *dict) {
const char *method_name = "parse_conf_obs_qty_exc() -> ";

StringArray sa = parse_conf_string_array(dict, conf_key_obs_qty_exc, method_name);

return(sa);
}

Expand Down
3 changes: 2 additions & 1 deletion met/src/basic/vx_config/config_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ extern StringArray parse_conf_sid_list(Dictionary *dict, const char *);
extern void parse_sid_mask(const ConcatString &, StringArray &, ConcatString &);
extern vector<MaskLatLon>
parse_conf_llpnt_mask(Dictionary *dict);
extern StringArray parse_conf_obs_qty(Dictionary *dict);
extern StringArray parse_conf_obs_qty_inc(Dictionary *dict);
extern StringArray parse_conf_obs_qty_exc(Dictionary *dict);
extern NumArray parse_conf_ci_alpha(Dictionary *dict);
extern NumArray parse_conf_eclv_points(Dictionary *dict);
extern ClimoCDFInfo parse_conf_climo_cdf(Dictionary *dict);
Expand Down
36 changes: 22 additions & 14 deletions met/src/libcode/vx_statistics/pair_data_ensemble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,9 @@ void VxPairDataEnsemble::clear() {

sid_inc_filt.clear();
sid_exc_filt.clear();
obs_qty_filt.clear();

obs_qty_inc_filt.clear();
obs_qty_exc_filt.clear();

obs_error_info = (ObsErrorInfo *) 0;

fcst_ut = (unixtime) 0;
Expand Down Expand Up @@ -954,7 +955,8 @@ void VxPairDataEnsemble::assign(const VxPairDataEnsemble &vx_pd) {
end_ut = vx_pd.end_ut;
sid_inc_filt = vx_pd.sid_inc_filt;
sid_exc_filt = vx_pd.sid_exc_filt;
obs_qty_filt = vx_pd.obs_qty_filt;
obs_qty_inc_filt = vx_pd.obs_qty_inc_filt;
obs_qty_exc_filt = vx_pd.obs_qty_exc_filt;
obs_error_info = vx_pd.obs_error_info;

interp_thresh = vx_pd.interp_thresh;
Expand Down Expand Up @@ -1132,9 +1134,18 @@ void VxPairDataEnsemble::set_sid_exc_filt(const StringArray sa) {

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

void VxPairDataEnsemble::set_obs_qty_filt(const StringArray q) {
void VxPairDataEnsemble::set_obs_qty_inc_filt(const StringArray q) {

obs_qty_filt = q;
obs_qty_inc_filt = q;

return;
}

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

void VxPairDataEnsemble::set_obs_qty_exc_filt(const StringArray q) {

obs_qty_exc_filt = q;

return;
}
Expand Down Expand Up @@ -1368,16 +1379,13 @@ void VxPairDataEnsemble::add_point_obs(float *hdr_arr, int *hdr_typ_arr,
else if(obs_info_grib->code() != nint(obs_arr[1])) {
return;
}

// Check if the observation quality flag is included in the list
if(obs_qty_filt.n() && strcmp(obs_qty, "")) {
bool qty_match = false;
for(i=0; i<obs_qty_filt.n() && !qty_match; i++)
if( obs_qty == obs_qty_filt[i]) qty_match = true;

if(!qty_match) return;

// Check the observation quality include and exclude options
if((obs_qty_inc_filt.n() > 0 && !obs_qty_inc_filt.has(obs_qty)) ||
(obs_qty_exc_filt.n() > 0 && obs_qty_exc_filt.has(obs_qty))) {
return;
}

// Check whether the observation time falls within the valid time
// window
if(hdr_ut < beg_ut || hdr_ut > end_ut) return;
Expand Down
10 changes: 6 additions & 4 deletions met/src/libcode/vx_statistics/pair_data_ensemble.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ class VxPairDataEnsemble {

StringArray sid_inc_filt; // Station ID inclusion list
StringArray sid_exc_filt; // Station ID exclusion list
StringArray obs_qty_filt; // Observation quality markers

StringArray obs_qty_inc_filt; // Observation quality include markers
StringArray obs_qty_exc_filt; // Observation quality exclude markers

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

ObsErrorInfo *obs_error_info; // Pointer for observation error
Expand Down Expand Up @@ -249,8 +250,9 @@ class VxPairDataEnsemble {

void set_sid_inc_filt(const StringArray);
void set_sid_exc_filt(const StringArray);
void set_obs_qty_filt(const StringArray);

void set_obs_qty_inc_filt(const StringArray);
void set_obs_qty_exc_filt(const StringArray);

// Call set_pd_size before set_msg_typ, set_mask_area, and set_interp
void set_pd_size(int, int, int);

Expand Down
42 changes: 24 additions & 18 deletions met/src/libcode/vx_statistics/pair_data_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ void VxPairDataPoint::clear() {
climo_sd_dpa.clear();
sid_inc_filt.clear();
sid_exc_filt.clear();
obs_qty_filt.clear();
obs_qty_inc_filt.clear();
obs_qty_exc_filt.clear();
mpr_column.clear();
mpr_thresh.clear();

Expand Down Expand Up @@ -433,7 +434,8 @@ void VxPairDataPoint::assign(const VxPairDataPoint &vx_pd) {

sid_inc_filt = vx_pd.sid_inc_filt;
sid_exc_filt = vx_pd.sid_exc_filt;
obs_qty_filt = vx_pd.obs_qty_filt;
obs_qty_inc_filt = vx_pd.obs_qty_inc_filt;
obs_qty_exc_filt = vx_pd.obs_qty_exc_filt;

mpr_column = vx_pd.mpr_column;
mpr_thresh = vx_pd.mpr_thresh;
Expand Down Expand Up @@ -629,9 +631,18 @@ void VxPairDataPoint::set_sid_exc_filt(const StringArray &sa) {

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

void VxPairDataPoint::set_obs_qty_filt(const StringArray &sa) {
void VxPairDataPoint::set_obs_qty_inc_filt(const StringArray &sa) {

obs_qty_filt = sa;
obs_qty_inc_filt = sa;

return;
}

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

void VxPairDataPoint::set_obs_qty_exc_filt(const StringArray &sa) {

obs_qty_exc_filt = sa;

return;
}
Expand Down Expand Up @@ -899,10 +910,10 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,
rej_sid++;
return;
}

// Check whether the GRIB code for the observation matches
// the specified code
if((var_name != 0) && (0 < m_strlen(var_name))) {
if((var_name != 0) && (0 < strlen(var_name))) {
if(var_name != obs_info->name()) {
rej_var++;
return;
Expand All @@ -912,19 +923,14 @@ void VxPairDataPoint::add_point_obs(float *hdr_arr, const char *hdr_typ_str,
rej_var++;
return;
}

// Check if the observation quality flag is included in the list
if(obs_qty_filt.n() && strcmp(obs_qty, "")) {
bool qty_match = false;
for(i=0; i<obs_qty_filt.n() && !qty_match; i++) {
if(obs_qty == obs_qty_filt[i]) qty_match = true;
}
if(!qty_match) {
rej_qty++;
return;
}

// Check the observation quality include and exclude options
if((obs_qty_inc_filt.n() > 0 && !obs_qty_inc_filt.has(obs_qty)) ||
(obs_qty_exc_filt.n() > 0 && obs_qty_exc_filt.has(obs_qty))) {
rej_qty++;
return;
}

// Check whether the observation time falls within the valid time
// window
if(hdr_ut < beg_ut || hdr_ut > end_ut) {
Expand Down
10 changes: 6 additions & 4 deletions met/src/libcode/vx_statistics/pair_data_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ class VxPairDataPoint {

StringArray sid_inc_filt; // Station ID inclusion list
StringArray sid_exc_filt; // Station ID exclusion list
StringArray obs_qty_filt; // Observation quality markers

StringArray obs_qty_inc_filt; // Observation quality include markers
StringArray obs_qty_exc_filt; // Observation quality exclude markers

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

StringArray mpr_column; // Names of MPR columns or diffs of columns
Expand Down Expand Up @@ -199,8 +200,9 @@ class VxPairDataPoint {

void set_sid_inc_filt(const StringArray &);
void set_sid_exc_filt(const StringArray &);
void set_obs_qty_filt(const StringArray &);

void set_obs_qty_inc_filt(const StringArray &);
void set_obs_qty_exc_filt(const StringArray &);

// Call set_pd_size before set_msg_typ, set_mask_area, and set_interp
void set_pd_size(int, int, int);

Expand Down
2 changes: 2 additions & 0 deletions met/src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
// 029 01/21/20 Halley Gotway Add RPS output line type.
// 030 02/19/21 Halley Gotway MET #1450, #1451 Overhaul CRPS
// statistics in the ECNT line type.
// 031 09/13/21 Seth Linden Changed obs_qty to obs_qty_inc.
// Added code for obs_qty_exc.
//
////////////////////////////////////////////////////////////////////////

Expand Down
17 changes: 10 additions & 7 deletions met/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -819,19 +819,22 @@ void EnsembleStatVxOpt::process_config(GrdFileType ftype, Dictionary &fdict,
<< "Observation error for point verification is "
<< "defined by a table lookup for each observation.\n";
}

// Conf: desc
vx_pd.set_desc(parse_conf_string(&odict, conf_key_desc).c_str());

// Conf: sid_inc
vx_pd.set_sid_inc_filt(parse_conf_sid_list(&odict, conf_key_sid_inc));

// Conf: sid_exc
vx_pd.set_sid_exc_filt(parse_conf_sid_list(&odict, conf_key_sid_exc));

// Conf: obs_qty
vx_pd.set_obs_qty_filt(parse_conf_obs_qty(&odict));


// Conf: obs_qty_inc
vx_pd.set_obs_qty_inc_filt(parse_conf_obs_qty_inc(&odict));

// Conf: obs_qty_exc
vx_pd.set_obs_qty_exc_filt(parse_conf_obs_qty_exc(&odict));

return;
}

Expand Down
Loading