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 <[email protected]> Authored: Tue Feb 2 13:55:22 2016 -0800 Committer: huikyole <[email protected]> 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
