From 4c7f62f50604654609f5a32fbced1a4127cf167d Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 28 May 2021 11:15:50 -0600 Subject: [PATCH] Per #1749, add hss_ec_value as a configurable option for Point-Stat and 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. --- met/data/config/GridStatConfig_default | 1 + met/data/config/PointStatConfig_default | 1 + met/src/basic/vx_config/config_constants.h | 1 + met/src/libcode/vx_statistics/met_stats.cc | 8 ++++++++ met/src/tools/core/grid_stat/grid_stat.cc | 1 + met/src/tools/core/grid_stat/grid_stat_conf_info.cc | 6 +++++- met/src/tools/core/grid_stat/grid_stat_conf_info.h | 3 ++- met/src/tools/core/point_stat/point_stat.cc | 1 + met/src/tools/core/point_stat/point_stat_conf_info.cc | 6 +++++- met/src/tools/core/point_stat/point_stat_conf_info.h | 1 + 10 files changed, 26 insertions(+), 3 deletions(-) diff --git a/met/data/config/GridStatConfig_default b/met/data/config/GridStatConfig_default index c4622bf371..73eb163f92 100644 --- a/met/data/config/GridStatConfig_default +++ b/met/data/config/GridStatConfig_default @@ -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 diff --git a/met/data/config/PointStatConfig_default b/met/data/config/PointStatConfig_default index d52efc6a20..22fe98c3dc 100644 --- a/met/data/config/PointStatConfig_default +++ b/met/data/config/PointStatConfig_default @@ -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 diff --git a/met/src/basic/vx_config/config_constants.h b/met/src/basic/vx_config/config_constants.h index 2bb5acbeb8..d3b8773e58 100644 --- a/met/src/basic/vx_config/config_constants.h +++ b/met/src/basic/vx_config/config_constants.h @@ -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"; diff --git a/met/src/libcode/vx_statistics/met_stats.cc b/met/src/libcode/vx_statistics/met_stats.cc index 159e7a5d88..244ee8b5cc 100644 --- a/met/src/libcode/vx_statistics/met_stats.cc +++ b/met/src/libcode/vx_statistics/met_stats.cc @@ -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(); diff --git a/met/src/tools/core/grid_stat/grid_stat.cc b/met/src/tools/core/grid_stat/grid_stat.cc index 310677504d..ab142156ed 100644 --- a/met/src/tools/core/grid_stat/grid_stat.cc +++ b/met/src/tools/core/grid_stat/grid_stat.cc @@ -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. // //////////////////////////////////////////////////////////////////////// diff --git a/met/src/tools/core/grid_stat/grid_stat_conf_info.cc b/met/src/tools/core/grid_stat/grid_stat_conf_info.cc index 20b1dec99e..c34e790481 100644 --- a/met/src/tools/core/grid_stat/grid_stat_conf_info.cc +++ b/met/src/tools/core/grid_stat/grid_stat_conf_info.cc @@ -530,6 +530,7 @@ void GridStatVxOpt::clear() { grad_dy.clear(); rank_corr_flag = false; + hss_ec_value = bad_data_double; for(i=0; i