Skip to content

Commit

Permalink
Per #1749, add hss_ec_value as a configurable option for Point-Stat a…
Browse files Browse the repository at this point in the history
…nd Grid-Stat. Still need to actually compute it correctly, add it to other test config files, add support to series_analysis/stat_analysis, update the docs, and make writeup corresponding issues for other METplus components.
  • Loading branch information
JohnHalleyGotway committed May 28, 2021
1 parent eb70070 commit 4c7f62f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions met/data/config/GridStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ eclv_points = 0.05;
nc_pairs_var_name = "";
nc_pairs_var_suffix = "";
rank_corr_flag = FALSE;
hss_ec_value = NA;

//
// Forecast and observation fields to be verified
Expand Down
1 change: 1 addition & 0 deletions met/data/config/PointStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ wind_thresh = [ NA ];
wind_logic = UNION;
eclv_points = 0.05;
rank_corr_flag = FALSE;
hss_ec_value = NA;

//
// Forecast and observation fields to be verified
Expand Down
1 change: 1 addition & 0 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ static const char conf_key_duplicate_flag[] = "duplicate_flag";
static const char conf_key_obs_summary[] = "obs_summary";
static const char conf_key_percentile[] = "obs_perc_value";
static const char conf_key_rank_corr_flag[] = "rank_corr_flag";
static const char conf_key_hss_ec_value[] = "hss_ec_value";
static const char conf_key_tmp_dir[] = "tmp_dir";
static const char conf_key_output_prefix[] = "output_prefix";
static const char conf_key_met_data_dir[] = "met_data_dir";
Expand Down
8 changes: 8 additions & 0 deletions met/src/libcode/vx_statistics/met_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,14 @@ void MCTSInfo::add(double f, double o, double cmn, double csd) {

void MCTSInfo::compute_stats() {

//
// Set the HSS expected correct value, if needed.
// Default to 1 divided by the number of categories.
//
if(is_bad_data(ec_value) && cts.nrows() > 0) {
ec_value = 1.0/cts.nrows();
}

acc.v = cts.gaccuracy();
hk.v = cts.gkuiper();
hss.v = cts.gheidke();
Expand Down
1 change: 1 addition & 0 deletions met/src/tools/core/grid_stat/grid_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
// nc_pairs_var_str to nc_pairs_var_suffix.
// 051 03/28/21 Halley Gotway Add mpr_column and mpr_thresh
// filtering options.
// 052 05/28/21 Halley Gotway Add MCTS HSS_EC output.
//
////////////////////////////////////////////////////////////////////////

Expand Down
6 changes: 5 additions & 1 deletion met/src/tools/core/grid_stat/grid_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ void GridStatVxOpt::clear() {
grad_dy.clear();

rank_corr_flag = false;
hss_ec_value = bad_data_double;

for(i=0; i<n_txt; i++) output_flag[i] = STATOutputType_None;

Expand Down Expand Up @@ -813,6 +814,9 @@ void GridStatVxOpt::process_config(
// Conf: rank_corr_flag
rank_corr_flag = odict.lookup_bool(conf_key_rank_corr_flag);

// Conf: hss_ec_value
hss_ec_value = odict.lookup_double(conf_key_hss_ec_value);

// Conf: nc_pairs_flag
parse_nc_info(odict);

Expand Down Expand Up @@ -891,7 +895,7 @@ bool GridStatVxOpt::is_uv_match(const GridStatVxOpt &v) const {
// eclv_points, cdf_info, ci_alpha
// boot_info, nbrhd_info,
// wave_1d_beg, wave_1d_end, grad_dx, grad_dy,
// rank_corr_flag, output_flag, nc_info
// rank_corr_flag, hss_ec_value, output_flag, nc_info
//

if(!(mask_grid == v.mask_grid ) ||
Expand Down
3 changes: 2 additions & 1 deletion met/src/tools/core/grid_stat/grid_stat_conf_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ class GridStatVxOpt {
double fom_alpha; // FOM Alpha
double zhu_weight; // Zhu Weight

bool rank_corr_flag; // Flag for computing rank correlations
bool rank_corr_flag; // Flag for computing rank correlations
double hss_ec_value; // MCTS HSS expected correct value

// Output file options
STATOutputType output_flag[n_txt]; // Flag for each output line type
Expand Down
1 change: 1 addition & 0 deletions met/src/tools/core/point_stat/point_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
// 044 01/24/20 Halley Gotway Add HiRA RPS output.
// 045 03/28/21 Halley Gotway Add mpr_column and mpr_thresh
// filtering options.
// 046 05/28/21 Halley Gotway Add MCTS HSS_EC output.
//
////////////////////////////////////////////////////////////////////////

Expand Down
6 changes: 5 additions & 1 deletion met/src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ void PointStatVxOpt::clear() {
hira_info.clear();

rank_corr_flag = false;
hss_ec_value = bad_data_double;

msg_typ.clear();

Expand Down Expand Up @@ -651,7 +652,7 @@ bool PointStatVxOpt::is_uv_match(const PointStatVxOpt &v) const {
// fwind_ta, owind_ta, wind_logic,
// eclv_points, cdf_info, ci_alpha
// boot_info, hira_info, rank_corr_flag,
// output_flag
// hss_ec_value, output_flag
//

if(!(beg_ds == v.beg_ds ) ||
Expand Down Expand Up @@ -871,6 +872,9 @@ void PointStatVxOpt::process_config(GrdFileType ftype,
// Conf: rank_corr_flag
rank_corr_flag = odict.lookup_bool(conf_key_rank_corr_flag);

// Conf: hss_ec_value
hss_ec_value = odict.lookup_double(conf_key_hss_ec_value);

// Conf: message_type
msg_typ = parse_conf_message_type(&odict);

Expand Down
1 change: 1 addition & 0 deletions met/src/tools/core/point_stat/point_stat_conf_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class PointStatVxOpt {
HiRAInfo hira_info; // HiRA verification logic

bool rank_corr_flag; // Flag for computing rank correlations
double hss_ec_value; // MCTS HSS expected correct value

StringArray msg_typ; // Array of message types

Expand Down

0 comments on commit 4c7f62f

Please sign in to comment.