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 03:59:28 UTC

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

Repository: climate
Updated Branches:
  refs/heads/master a4ccb10f7 -> 334194118


CLIMATE-743 - Update utils.normalize_lat_lon_values

- Any longitude values between 180 and 360 is converted to -180 and 0.


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

Branch: refs/heads/master
Commit: 51dd397d522c0471c01c29d1f522aeab45bc7c49
Parents: d9e3c7e
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Mon Feb 1 18:52:00 2016 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Mon Feb 1 18:52:00 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/climate/blob/51dd397d/ocw/utils.py
----------------------------------------------------------------------
diff --git a/ocw/utils.py b/ocw/utils.py
index 3c7beb0..442382a 100755
--- a/ocw/utils.py
+++ b/ocw/utils.py
@@ -43,6 +43,8 @@ def decode_time_values(dataset, time_var_name):
     '''
     time_data = dataset.variables[time_var_name]
     time_format = time_data.units
+    if time_format[-1].lower() == 'z':
+        time_format = time_format[:-1]
 
     time_units = parse_time_units(time_format)
     time_base = parse_time_base(time_format)
@@ -186,8 +188,7 @@ 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
-        if lons.min() > 180:
-            lons -= 360
+        lons[lons > 180] = lons[lons > 180] - 360.
 
     	# Make sure lats and lons are monotonically increasing
     	lats_decreasing = np.diff(lats) < 0
@@ -222,6 +223,9 @@ 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 - ocw.data_source.local.py cannot properly detect the altitude dimension

Posted by hu...@apache.org.
CLIMATE-743 - ocw.data_source.local.py cannot properly detect the altitude dimension

- In ocw.data_source.local.load_file, level_index is fixed as 1 (the 2nd dimension) if the input dataset has four dimensions.


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

Branch: refs/heads/master
Commit: 334194118ba663b2f0fdee3198e411e2c802885c
Parents: a4ccb10 51dd397
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Mon Feb 1 18:58:36 2016 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Mon Feb 1 18:58:36 2016 -0800

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