From 5ea217003f94fe9a078977198265cb0db41fd256 Mon Sep 17 00:00:00 2001 From: Eric Engle Date: Wed, 8 Nov 2023 08:18:43 -0500 Subject: [PATCH] Update for lat lon storage Changed storage object of lats and lons from a tuple in the data store to a dictionary with keys 'latitude' and 'longitude'. This is due to the Arakawa rotate grid (32769) that will generate rotation angles for vector quantities and we will want to store those as well. --- grib2io/_grib2io.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grib2io/_grib2io.py b/grib2io/_grib2io.py index cc52a1e..59ded75 100644 --- a/grib2io/_grib2io.py +++ b/grib2io/_grib2io.py @@ -940,7 +940,8 @@ def grid(self, unrotate=True): longitudes in units of degrees. """ if self._sha1_section3 in _latlon_datastore.keys(): - return _latlon_datastore[self._sha1_section3] + return (_latlon_datastore[self._sha1_section3]['latitude'], + _latlon_datastore[self._sha1_section3]['longitude']) gdtn = self.gridDefinitionTemplateNumber.value gdtmpl = self.gridDefinitionTemplate reggrid = self.gridDefinitionSection[2] == 0 # This means regular 2-d grid @@ -1020,7 +1021,8 @@ def grid(self, unrotate=True): else: raise ValueError('Unsupported grid') - _latlon_datastore[self._sha1_section3] = (lats,lons) + _latlon_datastore[self._sha1_section3] = dict(latitude=lats, + longitude=lons) return lats, lons