diff --git a/src/libcode/vx_statistics/pair_data_point.cc b/src/libcode/vx_statistics/pair_data_point.cc index ff7df4262e..c00859ff31 100644 --- a/src/libcode/vx_statistics/pair_data_point.cc +++ b/src/libcode/vx_statistics/pair_data_point.cc @@ -70,8 +70,8 @@ void PairDataPoint::init_from_scratch() { seeps_mpr.clear(); seeps.clear(); + seeps_climo = NULL; clear(); - seeps_climo = get_seeps_climo(); return; } @@ -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"; } //////////////////////////////////////////////////////////////////////// @@ -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++){ diff --git a/src/libcode/vx_statistics/pair_data_point.h b/src/libcode/vx_statistics/pair_data_point.h index ab44e87d17..f98a1ee376 100644 --- a/src/libcode/vx_statistics/pair_data_point.h +++ b/src/libcode/vx_statistics/pair_data_point.h @@ -34,6 +34,7 @@ class PairDataPoint : public PairBase { void assign(const PairDataPoint &); SeepsClimo *seeps_climo; + public: PairDataPoint(); @@ -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); @@ -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 *); diff --git a/src/tools/core/point_stat/point_stat_conf_info.cc b/src/tools/core/point_stat/point_stat_conf_info.cc index 6579d04574..48af077157 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.cc +++ b/src/tools/core/point_stat/point_stat_conf_info.cc @@ -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; }