Skip to content

Commit

Permalink
Feature #2532 tc_winds (#2561)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway authored Jun 9, 2023
1 parent 4178281 commit 2356283
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/Users_Guide/tc-pairs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ TC-Pairs produces output in TCST format. The default output file name can be ove
* - 35, 36
- A/BAL_WIND_34
- a/bdeck 34-knot radius winds in full circle
or the mean of the non-zero 34-knot wind quadrants
* - 37, 38
- A/BNE_WIND_34
- a/bdeck 34-knot radius winds in NE quadrant
Expand All @@ -547,6 +548,7 @@ TC-Pairs produces output in TCST format. The default output file name can be ove
* - 45, 46
- A/BAL_WIND_50
- a/bdeck 50-knot radius winds in full circle
or the mean of the non-zero 50-knot wind quadrants
* - 47, 48
- A/BNE_WIND_50
- a/bdeck 50-knot radius winds in NE quadrant
Expand All @@ -562,6 +564,7 @@ TC-Pairs produces output in TCST format. The default output file name can be ove
* - 55, 56
- A/BAL_WIND_64
- a/bdeck 64-knot radius winds in full circle
or the mean of the non-zero 64-knot wind quadrants
* - 57, 58
- A/BNE_WIND_64
- a/bdeck 64-knot radius winds in NE quadrant
Expand Down
26 changes: 26 additions & 0 deletions src/libcode/vx_tc_util/track_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ void QuadInfo::set_wind(const ATCFTrackLine &l) {
l.radius1(), l.radius2(),
l.radius3(), l.radius4());

// MET #2532 Derive ALVal from quadrants
if(is_bad_data(ALVal)) set_al_from_quad_vals();

return;
}

Expand Down Expand Up @@ -273,6 +276,29 @@ void QuadInfo::set_quad_vals(QuadrantType ref_quad,
return;
}

////////////////////////////////////////////////////////////////////////
//
// MET #2532:
// Compute the full circle value as the mean of the non-zero quadrants.
//
////////////////////////////////////////////////////////////////////////

void QuadInfo::set_al_from_quad_vals() {
double s = 0.0;
int n = 0;

if(!is_bad_data(NEVal) || !is_bad_data(SEVal) ||
!is_bad_data(SWVal) || !is_bad_data(NWVal)) {
if(NEVal > 0) { s += NEVal; n++; }
if(SEVal > 0) { s += SEVal; n++; }
if(SWVal > 0) { s += SWVal; n++; }
if(NWVal > 0) { s += NWVal; n++; }
ALVal = (n > 0 ? s/n : 0.0);
}

return;
}

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

bool QuadInfo::is_match_wind(const ATCFTrackLine &l) const {
Expand Down
1 change: 1 addition & 0 deletions src/libcode/vx_tc_util/track_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class QuadInfo {
void set_wind(const ATCFTrackLine &);
void set_seas(const ATCFTrackLine &);
void set_quad_vals(QuadrantType, int, int, int, int);
void set_al_from_quad_vals();

void set_intensity(int);
void set_al_val(double);
Expand Down
1 change: 1 addition & 0 deletions src/tools/tc_utils/tc_pairs/tc_pairs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
// 013 09/28/22 Prestopnik MET #2227 Remove namespace std from header files
// 014 10/06/22 Halley Gotway MET #392 Incorporate diagnostics
// 015 02/20/23 Seth Linden MET #2429 Added option to prevent output of consensus track members
// 016 06/08/23 Halley Gotway MET #2532 Full circle winds are the mean of the non-zero quadrants
//
////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit 2356283

Please sign in to comment.