Skip to content

Commit

Permalink
Update for lat lon storage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EricEngle-NOAA committed Nov 8, 2023
1 parent e590758 commit 5ea2170
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions grib2io/_grib2io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5ea2170

Please sign in to comment.