Skip to content

Commit

Permalink
#1943 Load SEEPS climo only if SEEPS is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Dec 5, 2022
1 parent 05d4a8f commit 6700632
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
29 changes: 27 additions & 2 deletions src/libcode/vx_statistics/pair_data_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void PairDataPoint::init_from_scratch() {

seeps_mpr.clear();
seeps.clear();
seeps_climo = NULL;
clear();
seeps_climo = get_seeps_climo();

return;
}
Expand Down Expand Up @@ -180,8 +180,16 @@ bool PairDataPoint::add_point_pair(const char *sid, double lat, double lon,

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

void PairDataPoint::load_seeps_climo() {
if (NULL == seeps_climo) seeps_climo = get_seeps_climo();
}

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

void PairDataPoint::set_seeps_thresh(const SingleThresh &p1_thresh) {
seeps_climo->set_p1_thresh(p1_thresh);
if (NULL != seeps_climo) seeps_climo->set_p1_thresh(p1_thresh);
else mlog << Warning << "\nPairDataPoint::set_seeps_thresh() ignored t1_threshold."
<< " Load SEESP climo first\n\n";
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1470,6 +1478,23 @@ void VxPairDataPoint::set_obs_perc_value(int percentile) {

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

void VxPairDataPoint::load_seeps_climo() {
bool loaded = false;
for(int i=0; i < n_msg_typ; i++){
for(int j=0; j < n_mask; j++){
for(int k=0; k < n_interp; k++){
pd[i][j][k].load_seeps_climo();
loaded = true;
break;
}
if (loaded) break;
}
if (loaded) break;
}
}

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

void VxPairDataPoint::set_seeps_thresh(const SingleThresh &p1_thresh) {
for(int i=0; i < n_msg_typ; i++){
for(int j=0; j < n_mask; j++){
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_statistics/pair_data_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PairDataPoint : public PairBase {
void assign(const PairDataPoint &);

SeepsClimo *seeps_climo;

public:

PairDataPoint();
Expand All @@ -58,6 +59,7 @@ class PairDataPoint : public PairBase {
bool add_point_pair(const char *, double, double, double, double,
unixtime, double, double, double, double,
const char *, double, double, double);
void load_seeps_climo();
void set_seeps_thresh(const SingleThresh &p1_thresh);
void set_seeps_score(SeepsScore *, int index=-1);

Expand Down Expand Up @@ -227,6 +229,7 @@ class VxPairDataPoint {

void set_mpr_thresh(const StringArray &, const ThreshArray &);

void load_seeps_climo();
void set_seeps_thresh(const SingleThresh &p1_thresh);

void set_climo_cdf_info_ptr(const ClimoCDFInfo *);
Expand Down
6 changes: 5 additions & 1 deletion src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,11 @@ void PointStatVxOpt::set_vx_pd(PointStatConfInfo *conf_info) {
vx_pd.set_duplicate_flag(duplicate_flag);
vx_pd.set_obs_summary(obs_summary);
vx_pd.set_obs_perc_value(obs_perc);
vx_pd.set_seeps_thresh(seeps_p1_thresh);
if (output_flag[i_seeps_mpr] != STATOutputType_None
|| output_flag[i_seeps] != STATOutputType_None) {
vx_pd.load_seeps_climo();
vx_pd.set_seeps_thresh(seeps_p1_thresh);
}
return;
}

Expand Down

0 comments on commit 6700632

Please sign in to comment.