From commits-return-435-apmail-climate-commits-archive=climate.apache.org@climate.incubator.apache.org Thu Jul 25 19:09:15 2013 Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 29174102E4 for ; Thu, 25 Jul 2013 19:09:15 +0000 (UTC) Received: (qmail 44922 invoked by uid 500); 25 Jul 2013 19:09:14 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 44878 invoked by uid 500); 25 Jul 2013 19:09:12 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 44838 invoked by uid 99); 25 Jul 2013 19:09:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 19:09:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 19:09:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 76B0B2388831; Thu, 25 Jul 2013 19:08:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@climate.incubator.apache.org From: goodman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130725190847.76B0B2388831@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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