From 55cc71ce28e77ee1308c127fbc03e3c69db6e65e Mon Sep 17 00:00:00 2001 From: Zach Sherman <19153455+zssherman@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:55:15 -0600 Subject: [PATCH] FIX: Update sigmet reader to handle 1byte kdp, that needs to be divided by wavelength. (#1707) * FIX: Update sigmet reader to handle 1byte kdp, that needs to be divided by wavelength. * FIX: Weird style issues. * Update pyart/io/_sigmetfile.pyx * Update pyart/io/_sigmetfile.pyx * FIX: ANother style fix and doc fix possibly. --- doc/environment.yml | 1 - pyart/io/_sigmetfile.pyx | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/environment.yml b/doc/environment.yml index ab92bd8da4..3f9549d4fe 100644 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -41,4 +41,3 @@ dependencies: - pip: - pooch - versioneer - - -e .. diff --git a/pyart/io/_sigmetfile.pyx b/pyart/io/_sigmetfile.pyx index c0f31f34e2..9b2faec92b 100644 --- a/pyart/io/_sigmetfile.pyx +++ b/pyart/io/_sigmetfile.pyx @@ -213,7 +213,12 @@ cdef class SigmetFile: prt_value = 1. / self.product_hdr['product_end']['prf'] nyquist = wavelength_cm / (10000.0 * 4.0 * prt_value) data['WIDTH'] *= nyquist - + # scale 1-byte KDP by the wavelength + if 'KDP' in self.data_type_names: + # The IRIS Programmer's Manual indicates 1-byte differential phase format + # data should be divided by the wavelength in cm (section 4.3.12). + wavelength_cm = self.product_hdr['product_end']['wavelength'] + data['KDP'] /= wavelength_cm return data, metadata def _get_sweep(self, full_xhdr=False, raw_data=False):