Skip to content

Commit 00c8892

Browse files
authored
Merge pull request #236 from jswhit/issue235
fix for issue #235 (latlons doesn't work if only 1 latitude in grid)
2 parents 6f1c5a4 + 5416327 commit 00c8892

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Changelog

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version 2.1.6 (not yet released)
33
* switch dynamic version handling from pkg_resources (in setuptools) to packaging
44
* expose 'redtoreg' function for interpolating reduced to full gaussian
55
gridded fields, optimize function for 50x speedup.
6+
* Fix for issue #235 (`latlons` doesn't work when only a single latitude in grid).
67

78
version 2.1.5 release
89
=====================

src/pygrib/_pygrib.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,8 @@ cdef class gribmessage(object):
15391539
lat1 = self['latitudeOfFirstGridPointInDegrees']
15401540
lat2 = self['latitudeOfLastGridPointInDegrees']
15411541
lats = self['distinctLatitudes']
1542-
if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
1542+
if self['Nj'] > 1:
1543+
if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
15431544
lons = self['distinctLongitudes']
15441545
lons,lats = np.meshgrid(lons,lats)
15451546
elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid

0 commit comments

Comments
 (0)