Skip to content

Commit

Permalink
Per #1749, add the -hss_ec_value job command option to Stat-Analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed May 28, 2021
1 parent 98d1f17 commit 02fc34d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions met/data/config/STATAnalysisConfig_GO_Index
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ boot = {

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

hss_ec_value = NA;
rank_corr_flag = FALSE;
vif_flag = FALSE;
tmp_dir = "/tmp";
Expand Down
1 change: 1 addition & 0 deletions met/data/config/STATAnalysisConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ wmo_fisher_stats = [ "CNT:PR_CORR", "CNT:SP_CORR",

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

hss_ec_value = NA;
rank_corr_flag = FALSE;
vif_flag = FALSE;
tmp_dir = "/tmp";
Expand Down
1 change: 1 addition & 0 deletions met/scripts/config/STATAnalysisConfig
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ boot = {

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

hss_ec_value = NA;
rank_corr_flag = TRUE;
vif_flag = FALSE;
tmp_dir = "/tmp";
Expand Down
16 changes: 16 additions & 0 deletions met/src/libcode/vx_analysis_util/stat_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void STATAnalysisJob::clear() {
boot_interval = bad_data_int;
boot_rep_prop = bad_data_double;
n_boot_rep = bad_data_int;
hss_ec_value = bad_data_double;
rank_corr_flag = false;
vif_flag = false;

Expand Down Expand Up @@ -344,6 +345,7 @@ void STATAnalysisJob::assign(const STATAnalysisJob & aj) {
boot_rep_prop = aj.boot_rep_prop;
n_boot_rep = aj.n_boot_rep;

hss_ec_value = aj.hss_ec_value;
rank_corr_flag = aj.rank_corr_flag;
vif_flag = aj.vif_flag;

Expand Down Expand Up @@ -626,6 +628,9 @@ void STATAnalysisJob::dump(ostream & out, int depth) const {
out << prefix << "boot_seed = "
<< boot_seed << "\n";

out << prefix << "hss_ec_value = "
<< hss_ec_value << "\n";

out << prefix << "rank_corr_flag = "
<< rank_corr_flag << "\n";

Expand Down Expand Up @@ -1601,6 +1606,10 @@ void STATAnalysisJob::parse_job_command(const char *jobstring) {
set_boot_seed(jc_array[i+1].c_str());
i++;
}
else if(jc_array[i] == "-hss_ec_value") {
hss_ec_value = atof(jc_array[i+1].c_str());
i++;
}
else if(jc_array[i] == "-rank_corr_flag") {
rank_corr_flag = atoi(jc_array[i+1].c_str());
i++;
Expand Down Expand Up @@ -2767,6 +2776,13 @@ ConcatString STATAnalysisJob::get_jobstring() const {
}
}

// Jobs which write MCTS output
if(out_line_type.has(stat_mcts_str)) {

// hss_ec_value
js << "-hss_ec_value " << hss_ec_value << " ";
}

// Jobs which compute rank correlations
if(out_line_type.has(stat_cnt_str)) {

Expand Down
5 changes: 5 additions & 0 deletions met/src/libcode/vx_analysis_util/stat_job.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ class STATAnalysisJob {
char *boot_rng;
char *boot_seed;

//
// MCTS HSS Expected Correct rate
//
double hss_ec_value;

//
// Rank correlation flag
//
Expand Down
2 changes: 2 additions & 0 deletions met/src/tools/core/stat_analysis/aggr_stat_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ void aggr_mctc_lines(LineDataFile &f, STATAnalysisJob &job,
// Add a new map entry, if necessary
//
if(m.count(key) == 0) {
cur.set_ec_value(job.hss_ec_value);
aggr.valid_ts.clear();
aggr.acc_ts.clear();
aggr.mcts_info = cur;
Expand Down Expand Up @@ -3449,6 +3450,7 @@ void mpr_to_mcts(STATAnalysisJob &job, const AggrMPRInfo &info,
mcts_info.cts.set_size(job.out_fcst_thresh.n() + 1);
mcts_info.set_fthresh(job.out_fcst_thresh);
mcts_info.set_othresh(job.out_obs_thresh);
mcts_info.set_ec_value(job.hss_ec_value);

//
// If there are no matched pairs to process, return
Expand Down
4 changes: 3 additions & 1 deletion met/src/tools/core/stat_analysis/stat_analysis_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// -out_stat, but not both.
// 021 04/12/21 Halley Gotway MET #1735 Support multiple
// -out_thresh and -out_line_type options.
// 022 05/28/21 Halley Gotway Add MCTS HSS_EC output.
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -113,13 +114,14 @@ void set_job_from_config(MetConfig &c, STATAnalysisJob &job) {

job.out_alpha = c.lookup_double(conf_key_out_alpha, false);

boot_info = parse_conf_boot(&c);
boot_info = parse_conf_boot(&c);
job.boot_interval = boot_info.interval;
job.boot_rep_prop = boot_info.rep_prop;
job.n_boot_rep = boot_info.n_rep;
job.set_boot_rng(boot_info.rng.c_str());
job.set_boot_seed(boot_info.seed.c_str());

job.hss_ec_value = c.lookup_double(conf_key_hss_ec_value);
job.rank_corr_flag = (int) c.lookup_bool(conf_key_rank_corr_flag);
job.vif_flag = (int) c.lookup_bool(conf_key_vif_flag);

Expand Down

0 comments on commit 02fc34d

Please sign in to comment.