diff --git a/src/libcode/vx_tc_util/diag_file.h b/src/libcode/vx_tc_util/diag_file.h index 43e6efb385..5490a9f8fe 100644 --- a/src/libcode/vx_tc_util/diag_file.h +++ b/src/libcode/vx_tc_util/diag_file.h @@ -105,6 +105,7 @@ class DiagFile : public LineDataFile { double lat(int) const; double lon(int) const; + DiagType source() const; int n_diag() const; const StringArray & diag_name() const; bool has_diag(const std::string &) const; @@ -132,6 +133,7 @@ inline const ConcatString & DiagFile::cyclone() const { return(Cyclone); inline const StringArray & DiagFile::technique() const { return(Technique); } inline unixtime DiagFile::init() const { return(InitTime); } inline int DiagFile::n_time() const { return(NTime); } +inline DiagType DiagFile::source() const { return(SourceType); } inline int DiagFile::n_diag() const { return(DiagName.n()); } inline const StringArray & DiagFile::diag_name() const { return(DiagName); } diff --git a/src/libcode/vx_tc_util/track_info.cc b/src/libcode/vx_tc_util/track_info.cc index 65c6d49289..3b53f150c9 100644 --- a/src/libcode/vx_tc_util/track_info.cc +++ b/src/libcode/vx_tc_util/track_info.cc @@ -91,6 +91,7 @@ void TrackInfo::clear() { MaxValidTime = (unixtime) 0; MinWarmCore = (unixtime) 0; MaxWarmCore = (unixtime) 0; + DiagSource = DiagType_None; DiagName.clear(); TrackLines.clear(); @@ -131,6 +132,7 @@ void TrackInfo::dump(ostream &out, int indent_depth) const { out << prefix << "MaxValidTime = \"" << (MaxValidTime > 0 ? unix_to_yyyymmdd_hhmmss(MaxValidTime).text() : na_str) << "\n"; out << prefix << "MinWarmCore = \"" << (MinWarmCore > 0 ? unix_to_yyyymmdd_hhmmss(MinWarmCore).text() : na_str) << "\n"; out << prefix << "MaxWarmCore = \"" << (MaxWarmCore > 0 ? unix_to_yyyymmdd_hhmmss(MaxWarmCore).text() : na_str) << "\n"; + out << prefix << "DiagSource = " << diagtype_to_string(DiagSource) << "\n"; out << prefix << "NDiag = " << DiagName.n() << "\n"; out << prefix << "NPoints = " << NPoints << "\n"; out << prefix << "NAlloc = " << NAlloc << "\n"; @@ -169,6 +171,7 @@ ConcatString TrackInfo::serialize() const { << ", MaxValidTime = " << (MaxValidTime > 0 ? unix_to_yyyymmdd_hhmmss(MaxValidTime).text() : na_str) << ", MinWarmCore = " << (MinWarmCore > 0 ? unix_to_yyyymmdd_hhmmss(MinWarmCore).text() : na_str) << ", MaxWarmCore = " << (MaxWarmCore > 0 ? unix_to_yyyymmdd_hhmmss(MaxWarmCore).text() : na_str) + << ", DiagSource = " << diagtype_to_string(DiagSource) << ", NDiag = " << DiagName.n() << ", NPoints = " << NPoints << ", NAlloc = " << NAlloc @@ -219,6 +222,7 @@ void TrackInfo::assign(const TrackInfo &t) { MaxValidTime = t.MaxValidTime; MinWarmCore = t.MinWarmCore; MaxWarmCore = t.MaxWarmCore; + DiagSource = t.DiagSource; DiagName = t.DiagName; TrackLines = t.TrackLines; @@ -530,6 +534,9 @@ bool TrackInfo::add_diag_data(DiagFile &diag_file, const StringArray &diag_name) InitTime != diag_file.init() || !diag_file.technique().has(Technique)) return(false); + // Store the diagnostic source + DiagSource = diag_file.source(); + // If empty, store all diagnostics if(diag_name.n() > 0) DiagName = diag_name; else DiagName = diag_file.diag_name(); diff --git a/src/libcode/vx_tc_util/track_info.h b/src/libcode/vx_tc_util/track_info.h index c01d9a2fab..e227030f5c 100644 --- a/src/libcode/vx_tc_util/track_info.h +++ b/src/libcode/vx_tc_util/track_info.h @@ -70,7 +70,8 @@ class TrackInfo { unixtime MinWarmCore; unixtime MaxWarmCore; - // Diagnostic names + // Diagnostic source and names + DiagType DiagSource; StringArray DiagName; // TrackPoints @@ -113,6 +114,7 @@ class TrackInfo { void set_valid_min(const unixtime); void set_valid_max(const unixtime); void set_point(int, const TrackPoint &); + void set_diag_source(DiagType); void set_diag_name(const StringArray &); // @@ -144,6 +146,8 @@ class TrackInfo { int warm_core_dur() const; int valid_inc() const; int n_points() const; + + DiagType diag_source() const; int n_diag() const; const StringArray & diag_name() const; const char * diag_name(int) const; @@ -184,6 +188,7 @@ inline void TrackInfo::set_initials(const char *s) { Initials = s; inline void TrackInfo::set_init(const unixtime u) { InitTime = u; } inline void TrackInfo::set_valid_min(const unixtime u) { MinValidTime = u; } inline void TrackInfo::set_valid_max(const unixtime u) { MaxValidTime = u; } +inline void TrackInfo::set_diag_source(DiagType t) { DiagSource = t; } inline void TrackInfo::set_diag_name(const StringArray &s) { DiagName = s; } inline const ConcatString & TrackInfo::storm_id() const { return(StormId); } @@ -200,9 +205,12 @@ inline unixtime TrackInfo::valid_max() const { return(MaxVali inline unixtime TrackInfo::warm_core_min() const { return(MinWarmCore); } inline unixtime TrackInfo::warm_core_max() const { return(MaxWarmCore); } inline int TrackInfo::n_points() const { return(NPoints); } -inline int TrackInfo::n_diag() const { return(DiagName.n()); } -inline const StringArray & TrackInfo::diag_name() const { return(DiagName); } -inline StringArray TrackInfo::track_lines() const { return(TrackLines); } + +inline DiagType TrackInfo::diag_source() const { return(DiagSource); } +inline int TrackInfo::n_diag() const { return(DiagName.n()); } +inline const StringArray & TrackInfo::diag_name() const { return(DiagName); } + +inline StringArray TrackInfo::track_lines() const { return(TrackLines); } //////////////////////////////////////////////////////////////////////// //