From c18601b5943650a4d343c936f9230084ff8567e8 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Mon, 15 Mar 2021 13:49:11 -0600 Subject: [PATCH] Per #1714, add tc_gen genesis_match_window configuration option to define a search window relative to the forecast genesis time. --- met/data/config/TCGenConfig_default | 9 +++++++++ met/docs/Users_Guide/tc-gen.rst | 13 ++++++++++++- met/src/basic/vx_config/config_constants.h | 1 + met/src/libcode/vx_tc_util/genesis_info.cc | 7 ++++--- met/src/libcode/vx_tc_util/genesis_info.h | 4 ++-- met/src/tools/tc_utils/tc_gen/tc_gen.cc | 13 ++++++++----- met/src/tools/tc_utils/tc_gen/tc_gen_conf_info.cc | 10 ++++++++-- met/src/tools/tc_utils/tc_gen/tc_gen_conf_info.h | 9 ++++----- test/config/TCGenConfig_2016 | 9 +++++++++ 9 files changed, 57 insertions(+), 18 deletions(-) diff --git a/met/data/config/TCGenConfig_default b/met/data/config/TCGenConfig_default index db38b1302b..8c9f60a90b 100644 --- a/met/data/config/TCGenConfig_default +++ b/met/data/config/TCGenConfig_default @@ -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 // diff --git a/met/docs/Users_Guide/tc-gen.rst b/met/docs/Users_Guide/tc-gen.rst index 45bd9e7404..40efd7b746 100644 --- a/met/docs/Users_Guide/tc-gen.rst +++ b/met/docs/Users_Guide/tc-gen.rst @@ -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. ______________________ diff --git a/met/src/basic/vx_config/config_constants.h b/met/src/basic/vx_config/config_constants.h index 1ae8d5d90d..a2e730086a 100644 --- a/met/src/basic/vx_config/config_constants.h +++ b/met/src/basic/vx_config/config_constants.h @@ -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"; diff --git a/met/src/libcode/vx_tc_util/genesis_info.cc b/met/src/libcode/vx_tc_util/genesis_info.cc index 8cc5ea36d9..4124fdd873 100644 --- a/met/src/libcode/vx_tc_util/genesis_info.cc +++ b/met/src/libcode/vx_tc_util/genesis_info.cc @@ -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); } diff --git a/met/src/libcode/vx_tc_util/genesis_info.h b/met/src/libcode/vx_tc_util/genesis_info.h index bc4a511020..fa91077dc7 100644 --- a/met/src/libcode/vx_tc_util/genesis_info.h +++ b/met/src/libcode/vx_tc_util/genesis_info.h @@ -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; }; //////////////////////////////////////////////////////////////////////// diff --git a/met/src/tools/tc_utils/tc_gen/tc_gen.cc b/met/src/tools/tc_utils/tc_gen/tc_gen.cc index f3b614960c..f8d214642d 100644 --- a/met/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/met/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -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 &); @@ -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)) { @@ -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; @@ -610,7 +613,7 @@ int find_genesis_match(const GenesisInfo &fcst_gi, i