Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #1943 gridstat_seeps: Load SEEPS climo only if SEEPS is enabled #2368

Merged
merged 7 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ Note that writing out matched pair data (MPR lines) for a large number of cases

If all line types corresponding to a particular verification method are set to NONE, the computation of those statistics will be skipped in the code and thus make the Point-Stat tool run more efficiently. For example, if FHO, CTC, and CTS are all set to NONE, the Point-Stat tool will skip the categorical verification step.

The default SEEPS climo file exists at MET_BASE/share/met/climo/seeps/PPT24_seepsweights.nc. It can be overridden by using the environment variable, MET_SEEPS_POINT_CLIMO_NAME.
The default SEEPS climo file exists at MET_BASE/climo/seeps/PPT24_seepsweights.nc. It can be overridden by using the environment variable, MET_SEEPS_POINT_CLIMO_NAME.

.. _point_stat-output:

Expand Down
4 changes: 2 additions & 2 deletions docs/Users_Guide/reformat_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1164,10 +1164,10 @@ The script can be found at:

.. code-block:: none

MET_BASE/shared/met/utility/print_pointnc2ascii.py
MET_BASE/utility/print_pointnc2ascii.py

For how to use the script, issue the command:

.. code-block:: none

python3 MET_BASE/shared/met/utility/print_pointnc2ascii.py -h
python3 MET_BASE/utility/print_pointnc2ascii.py -h
26 changes: 23 additions & 3 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 SEEPS climo first\n\n";
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -291,7 +299,7 @@ SeepsScore *PairDataPoint::compute_seeps(const char *sid, double f,
int month, day, year, hour, minute, second;

int sid_no = atoi(sid);
if (sid_no) {
if (sid_no && NULL != seeps_climo) {
unix_to_mdyhms(ut, month, day, year, hour, minute, second);
seeps = seeps_climo->get_seeps_score(sid_no, f, o, month, hour);
if (mlog.verbosity_level() >= seeps_debug_level
Expand Down Expand Up @@ -1470,6 +1478,18 @@ void VxPairDataPoint::set_obs_perc_value(int percentile) {

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

void VxPairDataPoint::load_seeps_climo() {
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();
}
}
}
}

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

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