From aa858f3f45d0b268d6f88496759fab0e5ec1c345 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 12 Nov 2021 10:32:41 -0700 Subject: [PATCH] Per #1809, saving off the current state of development before proceeding with changes to simplify the matching logic. --- met/src/libcode/vx_tc_util/prob_gen_info.cc | 24 ++++ met/src/libcode/vx_tc_util/prob_gen_info.h | 8 +- met/src/tools/tc_utils/tc_gen/tc_gen.cc | 128 +++++++++++++++++++- met/src/tools/tc_utils/tc_pairs/Makefile.am | 1 + 4 files changed, 154 insertions(+), 7 deletions(-) diff --git a/met/src/libcode/vx_tc_util/prob_gen_info.cc b/met/src/libcode/vx_tc_util/prob_gen_info.cc index 863fc90bc1..e292ce897a 100644 --- a/met/src/libcode/vx_tc_util/prob_gen_info.cc +++ b/met/src/libcode/vx_tc_util/prob_gen_info.cc @@ -17,6 +17,8 @@ using namespace std; #include #include +#include "nav.h" + #include "prob_gen_info.h" #include "atcf_offsets.h" @@ -201,3 +203,25 @@ bool ProbGenInfo::add(const ATCFProbLine &l, double dland, bool check_dup) { } //////////////////////////////////////////////////////////////////////// + +bool ProbGenInfo::is_match(const TrackPoint &p, const double rad, + const int beg, const int end) const { + + // Check for matching in time and space + return(p.valid() >= (GenTime + beg) && + p.valid() <= (GenTime + end) && + gc_dist(Lat, Lon, p.lat(), p.lon()) <= rad); +} + +//////////////////////////////////////////////////////////////////////// + +bool ProbGenInfo::is_match(const GenesisInfo &gi, const double rad, + const int beg, const int end) const { + + // Input genesis point + const TrackPoint *p = gi.genesis(); + + return(p ? is_match(*p, rad, beg, end) : false); +} + +//////////////////////////////////////////////////////////////////////// diff --git a/met/src/libcode/vx_tc_util/prob_gen_info.h b/met/src/libcode/vx_tc_util/prob_gen_info.h index 1ce3dc10d5..49a6534ea1 100644 --- a/met/src/libcode/vx_tc_util/prob_gen_info.h +++ b/met/src/libcode/vx_tc_util/prob_gen_info.h @@ -16,6 +16,7 @@ #include #include "prob_info_base.h" +#include "genesis_info.h" #include "vx_util.h" @@ -69,7 +70,12 @@ class ProbGenInfo : public ProbInfoBase { void initialize(const ATCFProbLine &, double); bool is_match (const ATCFProbLine &) const; bool add (const ATCFProbLine &, double, bool check_dup = false); - + + bool is_match (const TrackPoint &, + const double, const int, const int) const; + bool is_match (const GenesisInfo &, + 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 dcbd87f7c6..eb65f75ec5 100644 --- a/met/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/met/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -95,6 +95,10 @@ static int find_genesis_match (const GenesisInfo &, const GenesisInfoArray &, const TrackInfoArray &, bool, double, int, int); +static int find_probgen_match (const ProbGenInfo &, + const GenesisInfoArray &, + const TrackInfoArray &, + bool, double, int, int); static void setup_txt_files (int, int); static void setup_table (AsciiTable &); @@ -725,8 +729,9 @@ void do_probgen_pct(const TCGenVxOpt &vx_opt, const GenesisInfoArray &best_ga, const TrackInfoArray &oper_ta, ProbGenPCTInfo &pgi) { - int i, j, prob_lead; + int i, j, i_bga, prob_lead; double prob_value; + bool dev_match, ops_match; // Initialize pgi.clear(); @@ -738,11 +743,12 @@ void do_probgen_pct(const TCGenVxOpt &vx_opt, // Store info about each probability of genesis forecast pgi.add(model_pa.prob_gen(i)); - // JHG search for a match! - // For now, just assume it's a hit. - // Also need to define SHC values. - bool dev_match = true; - bool ops_match = true; + // Search for a BEST track match + i_bga = find_probgen_match(model_pa.prob_gen(i), best_ga, oper_ta, + vx_opt.GenesisMatchPointTrack, + vx_opt.GenesisMatchRadius, + vx_opt.GenesisMatchBeg, + vx_opt.GenesisMatchEnd); // Loop over the individual probabilities for(j=0; j 6) { + mlog << Debug(6) << best_ga.serialize_r() << "\n"; + } + // Dump out track info + else { + for(i=0; i