Issue #1450 apply opposite scanning before flipping in grib decoder

Former-commit-id: 6a8066f3d4 [formerly 6a8066f3d4 [formerly ce2095697f1f00656bf6b778e565d708ddc6a29c]]
Former-commit-id: a3bfb8a14e
Former-commit-id: e1bc52b1d8
This commit is contained in:
Ben Steffensmeier 2013-01-03 11:44:13 -06:00
parent 05951d66c6
commit 1c472994ef

View file

@ -328,13 +328,6 @@ class GribDecoder():
if not thinnedGrid:
numpyDataArray = numpy.resize(data, (ny, nx))
# Check y direction scan mode
if scanMode & 64 == 64:
numpyDataArray = numpy.flipud(numpyDataArray)
# Check x direction scan mode
if scanMode & 128 == 128:
numpyDataArray = numpy.fliplr(numpyDataArray)
# Check if rows are scanned in opposite direction. If so, we need to flip them around
if scanMode & 16 == 16:
@ -356,6 +349,14 @@ class GribDecoder():
theRow = numpy.array(numpyDataArray[i], copy=True)
numpyDataArray[i] = theRow[::-1]
i = i + 2
# Check y direction scan mode
if scanMode & 64 == 64:
numpyDataArray = numpy.flipud(numpyDataArray)
# Check x direction scan mode
if scanMode & 128 == 128:
numpyDataArray = numpy.fliplr(numpyDataArray)
else:
if not thinnedGrid: