Skip to content

Commit

Permalink
Per #1714, add tc_gen genesis_match_window configuration option to de…
Browse files Browse the repository at this point in the history
…fine a search window relative to the forecast genesis time.
  • Loading branch information
JohnHalleyGotway committed Mar 15, 2021
1 parent 23dc482 commit c18601b
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 18 deletions.
9 changes: 9 additions & 0 deletions met/data/config/TCGenConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ dland_thresh = NA;
//
genesis_match_radius = 500;

//
// Time window in hours, relative to the model genesis time, to search for a
// matching Best track point
//
genesis_match_window = {
beg = 0;
end = 0;
}

//
// Radius in km for a development scoring method hit
//
Expand Down
13 changes: 12 additions & 1 deletion met/docs/Users_Guide/tc-gen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,18 @@ ______________________
genesis_match_radius = 500;
The **genesis_match_radius** entry defines a search radius, in km, relative to the forecast genesis location. When searching for a match, only those Best genesis events which occur within this radius will be considered. Increasing this search radius should lead to an increase in the number of matched genesis pairs.
The **genesis_match_radius** entry defines a search radius, in km, relative to the forecast genesis location. When searching for a match, only Best or operational tracks with a track point within this radius will be considered. Increasing this search radius should lead to an increase in the number of matched genesis pairs.

______________________

.. code-block:: none
genesis_match_window = {
beg = 0;
end = 0;
}
The **genesis_match_window** entry defines a time window, in hours, relative to the forecast genesis time. When searching for a match, only Best or operational tracks with a track point falling within this time window will be considered. The default time window of 0 requires a Best or operational track to exist at the forecast genesis time for a match to be found. Increasing this time window should lead to an increase in the number matched genesis pairs. For example, setting *beg = -12;* would allow the forecast genesis events to be up to 12 hours early.

______________________

Expand Down
1 change: 1 addition & 0 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ static const char conf_key_vmax_thresh[] = "vmax_thresh";
static const char conf_key_mslp_thresh[] = "mslp_thresh";
static const char conf_key_basin_mask[] = "basin_mask";
static const char conf_key_genesis_match_radius[] = "genesis_match_radius";
static const char conf_key_genesis_match_window[] = "genesis_match_window";
static const char conf_key_dev_hit_radius[] = "dev_hit_radius";
static const char conf_key_dev_hit_window[] = "dev_hit_window";
static const char conf_key_ops_hit_tdiff[] = "ops_hit_tdiff";
Expand Down
7 changes: 4 additions & 3 deletions met/src/libcode/vx_tc_util/genesis_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ int GenesisInfo::genesis_fhr() const {

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

bool GenesisInfo::is_match(const TrackPoint &p,
const double rad) const {
bool GenesisInfo::is_match(const TrackPoint &p, const double rad,
const int beg, const int end) const {

// Check for matching in time and space
return(GenesisTime == p.valid() &&
return(p.valid() >= (GenesisTime + beg) &&
p.valid() <= (GenesisTime + end) &&
gc_dist(Lat, Lon, p.lat(), p.lon()) <= rad);
}

Expand Down
4 changes: 2 additions & 2 deletions met/src/libcode/vx_tc_util/genesis_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class GenesisInfo : public TrackInfo {
// do stuff
//

bool is_match(const TrackPoint &,
const double) const;
bool is_match(const TrackPoint &, const double,
const int, const int) const;
};

////////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 8 additions & 5 deletions met/src/tools/tc_utils/tc_gen/tc_gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void do_genesis_ctc (const TCGenVxOpt &,
static int find_genesis_match (const GenesisInfo &,
const GenesisInfoArray &,
const TrackInfoArray &,
double);
double, int, int);

static void setup_txt_files (int, int);
static void setup_table (AsciiTable &);
Expand Down Expand Up @@ -377,7 +377,9 @@ void get_genesis_pairs(const TCGenVxOpt &vx_opt,

// Search for a BEST track match
i_bga = find_genesis_match(fga[i], bga, ota,
vx_opt.GenesisMatchRadius);
vx_opt.GenesisMatchRadius,
vx_opt.GenesisMatchBeg,
vx_opt.GenesisMatchEnd);

// Add the matched genesis pair
if(!is_bad_data(i_bga)) {
Expand Down Expand Up @@ -591,7 +593,8 @@ void do_genesis_ctc(const TCGenVxOpt &vx_opt,
int find_genesis_match(const GenesisInfo &fcst_gi,
const GenesisInfoArray &bga,
const TrackInfoArray &ota,
const double rad) {
const double rad,
const int beg, const int end) {
int i, j;
int i_best = bad_data_int;
int i_oper = bad_data_int;
Expand All @@ -610,7 +613,7 @@ int find_genesis_match(const GenesisInfo &fcst_gi,
i<bga.n() && is_bad_data(i_best);
i++) {
for(j=0; j<bga[i].n_points(); j++) {
if(fcst_gi.is_match(bga[i][j], rad)) {
if(fcst_gi.is_match(bga[i][j], rad, beg, end)) {
i_best = i;
mlog << Debug(4) << case_cs
<< " MATCHES BEST track "
Expand All @@ -627,7 +630,7 @@ int find_genesis_match(const GenesisInfo &fcst_gi,
i<ota.n() && is_bad_data(i_oper);
i++) {
for(j=0; j<ota[i].n_points(); j++) {
if(fcst_gi.is_match(ota[i][j], rad)) {
if(fcst_gi.is_match(ota[i][j], rad, beg, end)) {
i_oper = i;
mlog << Debug(4) << case_cs
<< " MATCHES operational " << ota[i].technique()
Expand Down
10 changes: 8 additions & 2 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 @@ -157,6 +157,7 @@ void TCGenVxOpt::clear() {
VxAreaMask.clear();
DLandThresh.clear();
GenesisMatchRadius = bad_data_double;
GenesisMatchBeg = GenesisMatchEnd = bad_data_int;
DevHitRadius = bad_data_double;
DevHitBeg = DevHitEnd = bad_data_int;
OpsHitDSec = bad_data_int;
Expand Down Expand Up @@ -246,9 +247,14 @@ void TCGenVxOpt::process_config(Dictionary &dict) {
GenesisMatchRadius =
dict.lookup_double(conf_key_genesis_match_radius);

// Conf: genesis_match_window
dict2 = dict.lookup_dictionary(conf_key_genesis_match_window);
parse_conf_range_int(dict2, beg, end);
GenesisMatchBeg = beg*sec_per_hour;
GenesisMatchEnd = end*sec_per_hour;

// Conf: dev_hit_radius
DevHitRadius =
dict.lookup_double(conf_key_dev_hit_radius);
DevHitRadius = dict.lookup_double(conf_key_dev_hit_radius);

// Conf: genesis_hit_window
dict2 = dict.lookup_dictionary(conf_key_dev_hit_window);
Expand Down
9 changes: 4 additions & 5 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 @@ -133,14 +133,13 @@ class TCGenVxOpt {

// Temporal and spatial matching criteria
double GenesisMatchRadius;
int GenesisMatchBeg, GenesisMatchEnd;

// Temporal and spatial scoring options
double DevHitRadius;
int DevHitBeg, DevHitEnd;
int OpsHitDSec;

// Scoring methods
bool DiscardFlag;
bool DevFlag;
bool OpsFlag;
bool DiscardFlag, DevFlag, OpsFlag;

// Output file options
double CIAlpha;
Expand Down
9 changes: 9 additions & 0 deletions test/config/TCGenConfig_2016
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ dland_thresh = NA;
//
genesis_match_radius = 500;

//
// Time window in hours, relative to the model genesis time, to search for a
// matching Best track point
//
genesis_match_window = {
beg = 0;
end = 0;
}

//
// Radius in km for a development scoring method hit
//
Expand Down

0 comments on commit c18601b

Please sign in to comment.