Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issue #235 (latlons doesn't work if only 1 latitude in grid) #236

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version 2.1.6 (not yet released)
* switch dynamic version handling from pkg_resources (in setuptools) to packaging
* expose 'redtoreg' function for interpolating reduced to full gaussian
gridded fields, optimize function for 50x speedup.
* Fix for issue #235 (`latlons` doesn't work when only a single latitude in grid).

version 2.1.5 release
=====================
Expand Down
3 changes: 2 additions & 1 deletion src/pygrib/_pygrib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,8 @@ cdef class gribmessage(object):
lat1 = self['latitudeOfFirstGridPointInDegrees']
lat2 = self['latitudeOfLastGridPointInDegrees']
lats = self['distinctLatitudes']
if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
if self['Nj'] > 1:
if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
lons = self['distinctLongitudes']
lons,lats = np.meshgrid(lons,lats)
elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid
Expand Down
Loading