From 94e8ba4712531a5ed8d06ca412de56a8793db915 Mon Sep 17 00:00:00 2001 From: Zach Sherman <19153455+zssherman@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:23:10 -0500 Subject: [PATCH] ENH: Update nexrad level 3 reader to read super resolution data. (#1591) * ENH: Update nexrad level 3 reader to read super resolution data. * STY: PEP8 fixes. * STY: More PEP8 changes that somehow weren't caught. * STY: .......... --- pyart/default_config.py | 3 +++ pyart/io/nexrad_level3.py | 34 +++++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pyart/default_config.py b/pyart/default_config.py index 0adf11a187..876d654f47 100644 --- a/pyart/default_config.py +++ b/pyart/default_config.py @@ -1072,6 +1072,9 @@ 134: None, # High Resolution VIL 135: None, # Enhanced Echo Tops 138: radar_estimated_rain_rate, # Digital Storm Total Precipitation + 153: reflectivity, # Super Resolution Base Reflectivity Data Array + 154: velocity, # Super Resolution Base Velocity Data Array + 155: spectrum_width, # Super Resolution Base Spectrum Width Data Array 159: differential_reflectivity, # Digital Differential Reflectivity 161: cross_correlation_ratio, # Digital Correlation Coefficient 163: specific_differential_phase, # Digital Specific Differential Phase diff --git a/pyart/io/nexrad_level3.py b/pyart/io/nexrad_level3.py index f55e44bf9e..0b2ed137f4 100644 --- a/pyart/io/nexrad_level3.py +++ b/pyart/io/nexrad_level3.py @@ -280,7 +280,7 @@ def get_data(self): elif msg_code in [134]: mdata = self._get_data_msg_134() - elif msg_code in [94, 99, 182, 186]: + elif msg_code in [94, 99, 153, 154, 155, 182, 186]: hw31, hw32 = np.frombuffer(threshold_data[:4], ">i2") data = (self.raw_data - 2) * (hw32 / 10.0) + hw31 / 10.0 mdata = np.ma.array(data, mask=self.raw_data < 2) @@ -598,7 +598,24 @@ def _int16_to_float16(val): # List of product numbers for which Halfword 30 corresponds to sweep elev angle # Per Table V of the ICD -ELEVATION_ANGLE = [19, 20, 25, 27, 28, 30, 56, 94, 99, 159, 161, 163, 165] +ELEVATION_ANGLE = [ + 19, + 20, + 25, + 27, + 28, + 30, + 56, + 94, + 99, + 153, + 154, + 155, + 159, + 161, + 163, + 165, +] PRODUCT_RANGE_RESOLUTION = { 19: 1.0, # 124 nm @@ -618,6 +635,9 @@ def _int16_to_float16(val): 134: 1000.0, 135: 1000.0, 138: 1.0, + 153: 0.25, + 154: 0.25, + 155: 0.25, 159: 0.25, 161: 0.25, 163: 0.25, @@ -655,6 +675,9 @@ def _int16_to_float16(val): 134: 1, 135: 0, 138: 2, + 153: 0, + 154: 0, + 155: 0, 159: 0, 161: 0, 163: 0, @@ -803,6 +826,10 @@ def _int16_to_float16(val): 134, # High Resolution VIL 135, # Enhanced Echo Tops 138, # Digital Storm Total + # Super Resolution + 153, # Super Resolution Base Reflectivity Data Array + 154, # Super Resolution Base Velocity Data Array + 155, # Super Resolution Base Spectrum Width Data Array # Precipitation 159, # Digital Differential # Reflectivity @@ -861,9 +888,6 @@ def _int16_to_float16(val): # 147, # Storm Total Snow Depth # 150, # User Selectable Snow Water Equivalent # 151, # User Selectable Snow Depth -# 153, # Super Resolution Reflectivity Data Array -# 154, # Super Resolution Velocity Data Array -# 155, # Super Resolution Spectrum Width Data Array # 158, # Differential Reflectivity # 160, # Correlation Coefficient # 162, # Specific Differential Phase