From 27bd5ba7b8cf934efee0fb3f9a06051e872c1474 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Thu, 3 Jan 2013 11:44:13 -0600 Subject: [PATCH] Issue #1450 apply opposite scanning before flipping in grib decoder Former-commit-id: 03f9d510fe34e804f3c7fe77506effc47b9baf84 [formerly 6a8066f3d422c9cc08cd1dc7cde2cd73324b069d] [formerly 03f9d510fe34e804f3c7fe77506effc47b9baf84 [formerly 6a8066f3d422c9cc08cd1dc7cde2cd73324b069d] [formerly a3bfb8a14ef401ffeef3a97386c68140c35e81b5 [formerly ce2095697f1f00656bf6b778e565d708ddc6a29c]]] Former-commit-id: a3bfb8a14ef401ffeef3a97386c68140c35e81b5 Former-commit-id: 0102bdc392975c0e11104996c24104af779808a1 [formerly e1bc52b1d842aacc29097b831fce6bb68af7c850] Former-commit-id: 1c472994efc894f7b712bdf4b02fbea7a9a607ed --- .../com.raytheon.edex.plugin.grib/GribDecoder.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py b/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py index 1c310ca965..47d00f2970 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py +++ b/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py @@ -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: