climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [1/2] climate git commit: CLIMATE-748 - Debugging ocw.dataset_processor
Date Wed, 03 Feb 2016 05:28:55 GMT
Repository: climate
Updated Branches:
  refs/heads/master 027cea08c -> d34caaea5


CLIMATE-748 - Debugging ocw.dataset_processor

- dataset_processor.tempora_rebin has been fixed
- dataset_processor.spatial_regrid has been fixed


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

Branch: refs/heads/master
Commit: 7501df18991691be4b069420a5b84df0a8083dbd
Parents: 7f6bb69
Author: huikyole <huikyole@argo.jpl.nasa.gov>
Authored: Tue Feb 2 21:24:00 2016 -0800
Committer: huikyole <huikyole@argo.jpl.nasa.gov>
Committed: Tue Feb 2 21:24:00 2016 -0800

----------------------------------------------------------------------
 ocw/dataset_processor.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/7501df18/ocw/dataset_processor.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py
index 8ee5962..1825864 100755
--- a/ocw/dataset_processor.py
+++ b/ocw/dataset_processor.py
@@ -256,7 +256,10 @@ def spatial_regrid(target_dataset, new_latitudes, new_longitudes):
                       
     # Regrid the data on each time slice
     for i in range(len(target_dataset.times)):
-        values_original = ma.array(target_dataset.values[i])
+        if len(target_dataset.times) == 1:
+            values_original = ma.array(target_dataset.values)
+        else: 
+            values_original = ma.array(target_dataset.values[i])
         for shift in (-1, 1):
             for axis in (0, 1):
                 q_shifted = np.roll(values_original, shift=shift, axis=axis)
@@ -905,7 +908,7 @@ def _rcmes_calc_average_on_new_time_unit(data, dates, unit):
     nt, ny, nx = data.shape
     if unit == 'full':
         new_data = ma.mean(data, axis=0)
-        new_date = [dates[size(dates)/2]]
+        new_date = [dates[dates.size/2]]
     if unit == 'annual':
         years = [d.year for d in dates]
         years_sorted = np.unique(years)


Mime
View raw message