Skip to content

Commit

Permalink
Per #2339, first step... enhance Stat-Analysis to parse the SEEPS and…
Browse files Browse the repository at this point in the history
… SEEPS_MPR lines types.
  • Loading branch information
JohnHalleyGotway committed Nov 10, 2022
1 parent 7149c7d commit a346450
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcode/vx_stat_out/stat_columns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,7 @@ void write_seeps_cols(const SeepsAggScore *seeps,
at.set_entry(r, c+0, seeps->n_obs); // Total Number of Pairs

at.set_entry(r, c+1, seeps->s12); // s12
at.set_entry(r, c+2, seeps->s13); // S13
at.set_entry(r, c+2, seeps->s13); // s13
at.set_entry(r, c+3, seeps->s21); // s21
at.set_entry(r, c+4, seeps->s23); // s23
at.set_entry(r, c+5, seeps->s31); // s31
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_statistics/pair_data_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void PairDataPoint::clear() {
if (seeps_mpr[idx]) delete seeps_mpr[idx];
}
seeps_mpr.clear();
seeps.init();
seeps.clear();

return;
}
Expand Down
58 changes: 58 additions & 0 deletions src/tools/core/stat_analysis/parse_stat_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
// 009 10/09/17 Halley Gotway Add GRAD line type.
// 010 04/25/18 Halley Gotway Add ECNT line type.
// 011 01/24/20 Halley Gotway Add RPS line type.
// 012 11/10/22 Halley Gotway MET #2339 Add SEEPS and SEEPS_MPR
// line types.
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -549,3 +551,59 @@ void parse_ssvar_line(STATLine &l, SSVARInfo &ssvar_info) {
}

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

void parse_seeps_line(STATLine &l, SeepsAggScore &agg_score) {

agg_score.clear();

agg_score.n_obs = atoi(l.get_item("TOTAL"));

agg_score.s12 = atoi(l.get_item("S12"));
agg_score.s13 = atoi(l.get_item("S13"));
agg_score.s21 = atof(l.get_item("S21"));
agg_score.s23 = atof(l.get_item("S23"));
agg_score.s31 = atof(l.get_item("S31"));
agg_score.s32 = atof(l.get_item("S32"));

agg_score.pf1 = atof(l.get_item("PF1"));
agg_score.pf2 = atof(l.get_item("PF2"));
agg_score.pf3 = atof(l.get_item("PF3"));

agg_score.pv1 = atof(l.get_item("PV1"));
agg_score.pv2 = atof(l.get_item("PV2"));
agg_score.pv3 = atof(l.get_item("PV3"));

agg_score.mean_fcst = atof(l.get_item("MEAN_FCST"));
agg_score.mean_obs = atof(l.get_item("MEAN_OBS"));

agg_score.score = atof(l.get_item("SEEPS"));
agg_score.weighted_score = agg_score.score;

return;
}

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

void parse_seeps_mpr_line(STATLine &l, SEEPSMPRData &s_data) {

s_data.fcst_var = l.fcst_var();
s_data.obs_var = l.obs_var();

s_data.obs_sid = l.get_item("OBS_SID");
s_data.obs_lat = atof(l.get_item("OBS_LAT"));
s_data.obs_lon = atof(l.get_item("OBS_LON"));
s_data.fcst = atof(l.get_item("FCST"));
s_data.obs = atof(l.get_item("OBS"));
s_data.obs_qc = l.get_item("OBS_QC");

s_data.seeps_mpr.fcst_cat = atoi(l.get_item("FCST_CAT"));
s_data.seeps_mpr.obs_cat = atoi(l.get_item("OBS_CAT"));
s_data.seeps_mpr.p1 = atof(l.get_item("P1"));
s_data.seeps_mpr.p2 = atof(l.get_item("P2"));
s_data.seeps_mpr.t1 = atof(l.get_item("T1"));
s_data.seeps_mpr.t2 = atof(l.get_item("T2"));

return;
}

////////////////////////////////////////////////////////////////////////
15 changes: 15 additions & 0 deletions src/tools/core/stat_analysis/parse_stat_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
// 009 04/25/18 Halley Gotway Add ECNT line type.
// 010 01/24/20 Halley Gotway Add RPS line type.
// 011 09/28/22 Prestopnik MET #2227 Remove namespace std
// 012 11/10/22 Halley Gotway MET #2339 Add SEEPS and SEEPS_MPR
// line types.
//
////////////////////////////////////////////////////////////////////////

Expand All @@ -45,6 +47,7 @@
#include "vx_analysis_util.h"
#include "vx_util.h"
#include "vx_statistics.h"
#include "seeps.h"

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

Expand Down Expand Up @@ -102,6 +105,15 @@ struct ORANKData {
NumArray ens_na;
};

// SEEPS Matched Pair (SEEPS_MPR) data structure
struct SEEPSMPRData {
ConcatString fcst_var;
ConcatString obs_var;
ConcatString obs_sid, obs_qc;
double obs_lat, obs_lon, fcst, obs;
SeepsScore seeps_mpr;
};

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

extern void parse_fho_ctable (STATLine &, TTContingencyTable &);
Expand All @@ -128,6 +140,9 @@ extern void parse_relp_line (STATLine &, RELPData &);
extern void parse_orank_line (STATLine &, ORANKData &);
extern void parse_ssvar_line (STATLine &, SSVARInfo &);

extern void parse_seeps_line (STATLine &, SeepsAggScore &);
extern void parse_seeps_mpr_line(STATLine &, SEEPSMPRData &);

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

#endif // __PARSE_STAT_LINE_H__
Expand Down

0 comments on commit a346450

Please sign in to comment.