You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2013/07/25 21:08:47 UTC

svn commit: r1507093 - in /incubator/climate: branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py trunk/rcmet/src/main/python/rcmes/storage/files.py

Author: goodman
Date: Thu Jul 25 19:08:47 2013
New Revision: 1507093

URL: http://svn.apache.org/r1507093
Log:
CLIMATE-221 - Fixed error when attempting to shift longitude grids where starting longitude > 180

Modified:
    incubator/climate/branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py
    incubator/climate/trunk/rcmet/src/main/python/rcmes/storage/files.py

Modified: incubator/climate/branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py
URL: http://svn.apache.org/viewvc/incubator/climate/branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py?rev=1507093&r1=1507092&r2=1507093&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py (original)
+++ incubator/climate/branches/RefactorInput/rcmet/src/main/python/rcmes/storage/files.py Thu Jul 25 19:08:47 2013
@@ -691,7 +691,11 @@ def checkLatLon(latsin, lonsin, datain):
         latsout - 2D array of (rearranged) latitudes
         lonsout - 2D array of (rearranged) longitudes
         dataout - Array of (rearranged) data
-    """    
+    """
+    # Avoid unnecessary shifting if all lons are higher than 180
+    if lonsin.min() > 180:
+        lonsin -= 360
+        
     # Make sure lats and lons are monotonically increasing
     latsDecreasing = np.diff(latsin[:, 0]) < 0
     lonsDecreasing = np.diff(lonsin[0]) < 0

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/storage/files.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/storage/files.py?rev=1507093&r1=1507092&r2=1507093&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/storage/files.py (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/storage/files.py Thu Jul 25 19:08:47 2013
@@ -691,7 +691,11 @@ def checkLatLon(latsin, lonsin, datain):
         latsout - 2D array of (rearranged) latitudes
         lonsout - 2D array of (rearranged) longitudes
         dataout - Array of (rearranged) data
-    """    
+    """
+    # Avoid unnecessary shifting if all lons are higher than 180
+    if lonsin.min() > 180:
+        lonsin -= 360
+        
     # Make sure lats and lons are monotonically increasing
     latsDecreasing = np.diff(latsin[:, 0]) < 0
     lonsDecreasing = np.diff(lonsin[0]) < 0