climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From good...@apache.org
Subject 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
Date Thu, 25 Jul 2013 19:08:47 GMT
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



Mime
View raw message