Skip to content

Commit

Permalink
Committing 2 small changes not specifically related to #1714, but rel…
Browse files Browse the repository at this point in the history
…ated the processing of genesis tracks. When getting items from ATCFGenLines, the columns to be shifted are off by one. We had been shifting offset 2 up to 3, but it should have remained at 2. Also when initializing a TrackInfo object, set the StormID by calling ATCFLineBase::storm_id() instead of constructing it from BASIN:CYCLONE:YYYY. For ATCFGenLines we want to set the Storm ID equal to the 3rd column rather than constructing it!
  • Loading branch information
JohnHalleyGotway committed Apr 8, 2021
1 parent 612db89 commit 1569668
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions met/src/libcode/vx_tc_util/atcf_line_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ ConcatString ATCFLineBase::get_item(int i) const {
int i_col = i;

// For ATCFLineType_GenTrack:
// Columns 1 and 2 are consistent, use offsets 0 and 1
// Columns 4-20 are the same as columns 3-19 of ATCFLineType_Track
// Shift those column indices by 1.
if(Type == ATCFLineType_GenTrack && i >= 2 && i <= 18) i_col++;
// Columns 1 and 2 are consistent: use offsets 0 and 1
// Column 3 has the GenStormIdOffset: use offset 2
// Columns 4-20 are the same as columns 3-19 of ATCFLineType_Track:
// Shift offsets 3 through 18 up by 1.
if(Type == ATCFLineType_GenTrack && i >= 3 && i <= 18) i_col++;

cs = DataLine::get_item(i_col);

Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_tc_util/track_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void TrackInfo::initialize(const ATCFTrackLine &l, bool check_anly) {
MinValidTime = MaxValidTime = l.valid();

// Create the storm id
set_storm_id();
set_storm_id(l.storm_id().c_str());

return;
}
Expand Down

0 comments on commit 1569668

Please sign in to comment.