Skip to content

Commit

Permalink
Per #1809, keep track of the min/max BEST track genesis times, and we…
Browse files Browse the repository at this point in the history
… only need 1 PCT table, not two.
  • Loading branch information
JohnHalleyGotway committed Nov 12, 2021
1 parent aa858f3 commit 4141adb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
21 changes: 11 additions & 10 deletions met/src/tools/tc_utils/tc_gen/tc_gen_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1243,15 +1243,13 @@ void ProbGenPCTInfo::clear() {

Model.clear();
InitBeg = InitEnd = (unixtime) 0;
BestBeg = BestEnd = (unixtime) 0;

PCTDev.clear();
PCTOps.clear();
PCT.clear();

VxOpt = (const TCGenVxOpt *) 0;
LeadTimes.clear();

ValidGenesisDHrThresh.clear();

return;
}

Expand All @@ -1264,9 +1262,6 @@ void ProbGenPCTInfo::set_vx_opt(const TCGenVxOpt *vx_opt) {
// Store pointer
VxOpt = vx_opt;

// Store config options
ValidGenesisDHrThresh = VxOpt->ValidGenesisDHrThresh;

// Setup the default PCTInfo object
DefaultPCT.set_fthresh(VxOpt->ProbGenThresh);
DefaultPCT.allocate_n_alpha(1);
Expand All @@ -1283,19 +1278,25 @@ void ProbGenPCTInfo::add(const ProbGenInfo &pgi) {
// Store the model name
if(Model.empty()) Model = pgi.technique();

// Track the range of valid times
// Track the range of forecast initalization times
if(InitBeg == 0 || InitBeg > pgi.init()) InitBeg = pgi.init();
if(InitEnd == 0 || InitEnd < pgi.init()) InitEnd = pgi.init();

// Track the range of verifying BEST genesis events
if(pgi.best_gen()) {
unixtime ut = pgi.best_gen()->genesis_time();
if(BestBeg == 0 || BestBeg > ut) BestBeg = ut;
if(BestEnd == 0 || BestEnd < ut) BestEnd = ut;
}

// Add new map entry for each lead time, if needed
for(i=0; i<pgi.n_prob(); i++) {

lead_hr = nint(pgi.prob_item(i));

if(!LeadTimes.has(lead_hr)) {
LeadTimes.add(lead_hr);
PCTDev[lead_hr] = DefaultPCT;
PCTOps[lead_hr] = DefaultPCT;
PCT[lead_hr] = DefaultPCT;
}
}

Expand Down
5 changes: 2 additions & 3 deletions met/src/tools/tc_utils/tc_gen/tc_gen_conf_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,10 @@ class ProbGenPCTInfo {

ConcatString Model;
unixtime InitBeg, InitEnd;
unixtime BestBeg, BestEnd;
const TCGenVxOpt* VxOpt;
IntArray LeadTimes;
map<int,PCTInfo> PCTDev, PCTOps;

SingleThresh ValidGenesisDHrThresh;
map<int,PCTInfo> PCT;

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

Expand Down

0 comments on commit 4141adb

Please sign in to comment.