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 1575 large_diffs #1741

Merged
merged 20 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4307b18
Per #1575, add mpr_column and mpr_thresh entries to all of the Grid-S…
JohnHalleyGotway Mar 28, 2021
42f8fc7
Per #1575, define config strings to be parsed from the config files.
JohnHalleyGotway Mar 28, 2021
bd50708
Per #1575, store col_name_ptr and col_thresh_ptr in PairBase. They ar…
JohnHalleyGotway Mar 28, 2021
688fbbb
Per #1575, add MPR filtering logic to pair_data_point.cc. Include fil…
JohnHalleyGotway Mar 28, 2021
9a76f7a
Per #1575, update point_stat to parse the mpr_column and mpr_thresh c…
JohnHalleyGotway Mar 28, 2021
eaacfaf
Per #1575, updated Grid-Stat to parse mpr_column and mpr_thresh options.
JohnHalleyGotway Mar 28, 2021
2d08c43
Per #1575, update Point-Stat to store mpr_sa and mpr_ta locally and t…
JohnHalleyGotway Mar 28, 2021
cb00ea4
Per #1575, renamed PairDataEnsemble::subset_pairs() to subset_pairs_o…
JohnHalleyGotway Mar 30, 2021
5fc8996
Per #1575, some cleanup, moving check_fo_thresh() utility function fr…
JohnHalleyGotway Mar 30, 2021
94ff6a4
Per #1575, when implementing this for Grid-Stat, I realized that ther…
JohnHalleyGotway Mar 30, 2021
b7913b8
Per #1575, updating pair_data_point.h/.cc to handle the subsetting of…
JohnHalleyGotway Mar 30, 2021
9e3e7d8
Per #1575, rename subset_pairs() to subset_pairs_cnt_thresh() to be a…
JohnHalleyGotway Mar 30, 2021
96076cd
Per #1575, no real changes here. Just reorganizing the location of th…
JohnHalleyGotway Mar 30, 2021
dac057c
Per #1575, make the subset_pairs() utility function a member function…
JohnHalleyGotway Mar 30, 2021
27c257f
Per #1575, need to actually set the mpr_thresh!
JohnHalleyGotway Mar 30, 2021
b228eed
Per #1575, update subset_pairs_mpr_thresh() to make sure the StringAr…
JohnHalleyGotway Mar 30, 2021
d9b27ae
Per #1575, replace PairDataPoint::subset_pairs_mpr_thresh() with a ut…
JohnHalleyGotway Mar 31, 2021
1358c63
Per #1575, add documentation about mpr_column and mpr_thresh.
JohnHalleyGotway Mar 31, 2021
8acc282
Per #1575, mpr_columns can also include CLIMO_CDF.
JohnHalleyGotway Mar 31, 2021
af73fb0
Per #1575, add tests for Grid-Stat and Point-Stat to exercise the mpr…
JohnHalleyGotway Apr 1, 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
2 changes: 2 additions & 0 deletions met/data/config/GridStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/data/config/PointStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [ NA ];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
25 changes: 23 additions & 2 deletions met/docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ to be verified. This dictionary may include the following entries:
metadata of any output files, but the user can set the "desc" entry
accordingly.

Examples of user-defined conversion functions include:
Examples of user-defined data censoring operations include:

.. code-block:: none

censor_thresh = [ >12000 ];
censor_val = [ 12000 ];
censor_val = [ 12000 ];

* Several configuration options are provided to override and correct the
metadata read from the input file. The supported options are listed
Expand Down Expand Up @@ -678,6 +678,25 @@ to be verified. This dictionary may include the following entries:
is_wind_direction = boolean;
is_prob = boolean;

* The "mpr_column" and "mpr_thresh" entries are arrays of strings and
thresholds to specify which matched pairs should be included in the
statistics. These options apply to the Point-Stat and Grid-Stat tools.
They are parsed seperately for each "obs.field" array entry.
The "mpr_column" strings specify MPR column names ("FCST", "OBS",
"CLIMO_MEAN", "CLIMO_STDEV", or "CLIMO_CDF"), differences of columns
("FCST-OBS"), or the absolute value of those differences ("ABS(FCST-OBS)").
The number of "mpr_thresh" thresholds must match the number of "mpr_column"
entries, and the n-th threshold is applied to the n-th column. Any matched
pairs which do not meet any of the specified thresholds are excluded from
the analysis. For example, the following settings exclude matched pairs
where the observation value differs from the forecast or climatological
mean values by more than 10:

.. code-block:: none

mpr_column = [ "ABS(OBS-FCST)", "ABS(OBS-CLIMO_MEAN)" ];
mpr_thresh = [ <=10, <=10 ];

* The "cat_thresh" entry is an array of thresholds to be used when
computing categorical statistics.

Expand Down Expand Up @@ -981,6 +1000,8 @@ or
obs = {
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
wind_thresh = [ NA ];
Expand Down
4 changes: 3 additions & 1 deletion met/docs/Users_Guide/grid-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,15 @@ __________________________
type = [ { method = NEAREST; width = 1; } ]; }
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
eclv_points = 0.05;
rank_corr_flag = TRUE;
tmp_dir = "/tmp";
output_prefix = "";
version = "VN.N";

The configuration options listed above are common to many MET tools and are described in :numref:`config_options`.
The configuration options listed above are common to multiple MET tools and are described in :numref:`config_options`.

___________________________

Expand Down
4 changes: 3 additions & 1 deletion met/docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ ________________________
type = [ { method = NEAREST; width = 1; } ]; }
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
eclv_points = 0.05;
rank_corr_flag = TRUE;
sid_inc = [];
Expand All @@ -347,7 +349,7 @@ ________________________
output_prefix = "";
version = "VN.N";

The configuration options listed above are common to many MET tools and are described in :numref:`config_options`.
The configuration options listed above are common to multiple MET tools and are described in :numref:`config_options`.

_________________________

Expand Down
3 changes: 2 additions & 1 deletion met/scripts/config/GridStatConfig_APCP_12
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand All @@ -52,7 +54,6 @@ nc_pairs_var_name = "";
nc_pairs_var_suffix = "";
rank_corr_flag = FALSE;


//
// Forecast and observation fields to be verified
//
Expand Down
3 changes: 3 additions & 0 deletions met/scripts/config/GridStatConfig_APCP_24
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand All @@ -51,6 +53,7 @@ eclv_points = 0.05;
nc_pairs_var_name = "";
nc_pairs_var_suffix = "";
rank_corr_flag = FALSE;

//
// Forecast and observation fields to be verified
//
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/GridStatConfig_POP_12
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/GridStatConfig_all
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/PointStatConfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ regrid = {

censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
wind_thresh = [ NA ];
Expand Down
6 changes: 4 additions & 2 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ struct MaskLatLon {
//

enum DuplicateType {
DuplicateType_None, // Apply no logic for duplicate point obs
DuplicateType_None, // Apply no logic for duplicate point obs
DuplicateType_Unique // Filter out duplicate observation values
};

Expand All @@ -394,7 +394,7 @@ enum ObsSummary {
ObsSummary_None, // Keep all observations, no statistics
ObsSummary_Nearest, // Keep only the observation closest in time
ObsSummary_Min, // Keep only smallest value
ObsSummary_Max, // Keep only largest valueXS
ObsSummary_Max, // Keep only largest value
ObsSummary_UW_Mean, // Calculate un-weighted mean
ObsSummary_DW_Mean, // Calculate time weighted mean
ObsSummary_Median, // Calculate median
Expand Down Expand Up @@ -536,6 +536,8 @@ static const char conf_key_obs_qty[] = "obs_quality";
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";
static const char conf_key_mpr_column[] = "mpr_column";
static const char conf_key_mpr_thresh[] = "mpr_thresh";
static const char conf_key_cnt_thresh[] = "cnt_thresh";
static const char conf_key_cnt_logic[] = "cnt_logic";
static const char conf_key_cat_thresh[] = "cat_thresh";
Expand Down
40 changes: 0 additions & 40 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2285,46 +2285,6 @@ void check_mctc_thresh(const ThreshArray &ta) {

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

bool check_fo_thresh(const double f, const double o,
const double cmn, const double csd,
const SingleThresh &ft, const SingleThresh &ot,
const SetLogic type) {
bool status = true;
bool fcheck = ft.check(f, cmn, csd);
bool ocheck = ot.check(o, cmn, csd);
SetLogic t = type;

// If either of the thresholds is NA, reset the logic to intersection
// because an NA threshold is always true.
if(ft.get_type() == thresh_na || ot.get_type() == thresh_na) {
t = SetLogic_Intersection;
}

switch(t) {
case(SetLogic_Union):
if(!fcheck && !ocheck) status = false;
break;

case(SetLogic_Intersection):
if(!fcheck || !ocheck) status = false;
break;

case(SetLogic_SymDiff):
if(fcheck == ocheck) status = false;
break;

default:
mlog << Error << "\ncheck_fo_thresh() -> "
<< "Unexpected SetLogic value of " << type << ".\n\n";
exit(1);
break;
}

return(status);
}

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

const char * statlinetype_to_string(const STATLineType t) {
const char *s = (const char *) 0;

Expand Down
4 changes: 0 additions & 4 deletions met/src/basic/vx_config/config_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ extern void check_climo_n_vx(Dictionary *dict, const int);
extern InterpMthd int_to_interpmthd(int);
extern void check_mctc_thresh(const ThreshArray &);

extern bool check_fo_thresh(const double, const double, const double, const double,
const SingleThresh &, const SingleThresh &,
const SetLogic);

extern const char * statlinetype_to_string(const STATLineType);
extern void statlinetype_to_string(const STATLineType, char *);
extern STATLineType string_to_statlinetype(const char *);
Expand Down
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
2 changes: 2 additions & 0 deletions met/src/libcode/vx_statistics/pair_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class PairBase {
MaskLatLon *mask_llpnt_ptr; // Pointer to Lat/Lon thresholds
// which is not allocated

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

ConcatString msg_typ; // Name of the verifying message type
StringArray msg_typ_vals; // Message type values to be included

Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/pair_data_ensemble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ void PairDataEnsemble::compute_ssvar() {
//
////////////////////////////////////////////////////////////////////////

PairDataEnsemble PairDataEnsemble::subset_pairs(const SingleThresh &ot) const {
PairDataEnsemble PairDataEnsemble::subset_pairs_obs_thresh(const SingleThresh &ot) const {

// Check for no work to be done
if(ot.get_type() == thresh_na) return(*this);
Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/pair_data_ensemble.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class PairDataEnsemble : public PairBase {
void compute_phist();
void compute_ssvar();

PairDataEnsemble subset_pairs(const SingleThresh &ot) const;
PairDataEnsemble subset_pairs_obs_thresh(const SingleThresh &ot) const;
};

////////////////////////////////////////////////////////////////////////
Expand Down
Loading