-
Notifications
You must be signed in to change notification settings - Fork 24
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
Changes from 4 commits
6700632
ad89e66
31fba07
84efc94
c95fcb4
d9e4b13
6ce65cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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"; | ||||
} | ||||
|
||||
//////////////////////////////////////////////////////////////////////// | ||||
|
@@ -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 | ||||
|
@@ -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; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hsoh-u, I think PairDataPoint::load_seeps_climo() is just setting a pointer to a single instance of the SEEPS climo info. But that pointer should be set for each PairDataPoint object. So I don't think you should be breaking out of the loop based on the "loaded". You could just remove all the "loaded" stuff, as I've recommended here.
Suggested change
|
||||
break; | ||||
} | ||||
if (loaded) break; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
} | ||||
if (loaded) break; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. The singleton is implemented at vx_seeps/seeps.cc |
||||
} | ||||
} | ||||
|
||||
//////////////////////////////////////////////////////////////////////// | ||||
|
||||
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++){ | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.