You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2016/02/02 23:00:29 UTC

[1/2] climate git commit: CLIMATE-743 - Partially restore utils.normalize_lat_lon_values

Repository: climate
Updated Branches:
  refs/heads/master 4bcd9d071 -> 7f6bb691a


CLIMATE-743 - Partially restore utils.normalize_lat_lon_values

- the old longitude conversion is a correct way to handle datasets whose longitude values are between 180 and 360.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/b4b6fb1c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/b4b6fb1c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/b4b6fb1c

Branch: refs/heads/master
Commit: b4b6fb1cffbfbf7afdd45cdb74d86e28653437c6
Parents: 3341941
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Feb 2 13:55:22 2016 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Feb 2 13:55:22 2016 -0800

----------------------------------------------------------------------
 ocw/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/b4b6fb1c/ocw/utils.py
----------------------------------------------------------------------
diff --git a/ocw/utils.py b/ocw/utils.py
index 442382a..a839a25 100755
--- a/ocw/utils.py
+++ b/ocw/utils.py
@@ -188,7 +188,8 @@ def normalize_lat_lon_values(lats, lons, values):
     '''
     if lats.ndim ==1 and lons.ndim ==1:
         # Avoid unnecessary shifting if all lons are higher than 180
-        lons[lons > 180] = lons[lons > 180] - 360.
+        if lons.min() > 180:
+            lons-=360
 
     	# Make sure lats and lons are monotonically increasing
     	lats_decreasing = np.diff(lats) < 0
@@ -223,7 +224,6 @@ def normalize_lat_lon_values(lats, lons, values):
 
         return lats_out, lons_out, data_out
     else:
-        # Avoid unnecessary shifting if all lons are higher than 180
         lons[lons > 180] = lons[lons > 180] - 360.
 
         return lats, lons, values


[2/2] climate git commit: CLIMATE-743 - Partially restore utils.normalize_lat_lon_values

Posted by hu...@apache.org.
CLIMATE-743 - Partially restore utils.normalize_lat_lon_values

- the old longitude conversion is a correct way to handle datasets whose longitude values are between 180 and 360.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/7f6bb691
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/7f6bb691
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/7f6bb691

Branch: refs/heads/master
Commit: 7f6bb691aad01a45c9e1a9767dbee4ceb58a27b3
Parents: 4bcd9d0 b4b6fb1
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Feb 2 14:00:01 2016 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Feb 2 14:00:01 2016 -0800

----------------------------------------------------------------------
 ocw/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------