From 2356283156b33d0de659960ed5e6b04c07bd171d Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 9 Jun 2023 14:58:37 -0600 Subject: [PATCH] Feature #2532 tc_winds (#2561) --- docs/Users_Guide/tc-pairs.rst | 3 +++ src/libcode/vx_tc_util/track_point.cc | 26 +++++++++++++++++++++++++ src/libcode/vx_tc_util/track_point.h | 1 + src/tools/tc_utils/tc_pairs/tc_pairs.cc | 1 + 4 files changed, 31 insertions(+) diff --git a/docs/Users_Guide/tc-pairs.rst b/docs/Users_Guide/tc-pairs.rst index 556f7358c2..0533d5f649 100644 --- a/docs/Users_Guide/tc-pairs.rst +++ b/docs/Users_Guide/tc-pairs.rst @@ -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 @@ -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 @@ -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 diff --git a/src/libcode/vx_tc_util/track_point.cc b/src/libcode/vx_tc_util/track_point.cc index 52849ceb10..31ee582835 100644 --- a/src/libcode/vx_tc_util/track_point.cc +++ b/src/libcode/vx_tc_util/track_point.cc @@ -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; } @@ -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 { diff --git a/src/libcode/vx_tc_util/track_point.h b/src/libcode/vx_tc_util/track_point.h index f4acb29b6b..b6e4fb89be 100644 --- a/src/libcode/vx_tc_util/track_point.h +++ b/src/libcode/vx_tc_util/track_point.h @@ -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); diff --git a/src/tools/tc_utils/tc_pairs/tc_pairs.cc b/src/tools/tc_utils/tc_pairs/tc_pairs.cc index df144e8172..03ff8616c0 100644 --- a/src/tools/tc_utils/tc_pairs/tc_pairs.cc +++ b/src/tools/tc_utils/tc_pairs/tc_pairs.cc @@ -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 // ////////////////////////////////////////////////////////////////////////