climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [1/3] climate git commit: CLIMATE-698 - Handling missing values in ocw.dataset_processor.temporal_rebin_with_time_index
Date Thu, 22 Oct 2015 07:15:40 GMT
Repository: climate
Updated Branches:
  refs/heads/master f4e7bd61c -> ca9368645


CLIMATE-698 - Handling missing values in ocw.dataset_processor.temporal_rebin_with_time_index

- binned_values is now a numpy.ma array


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

Branch: refs/heads/master
Commit: dec62d2e5ad0b6ed69003c034a0e9d393b8b5042
Parents: f4e7bd6
Author: huikyole <huikyole@argo.jpl.nasa.gov>
Authored: Wed Oct 21 18:30:05 2015 -0700
Committer: huikyole <huikyole@argo.jpl.nasa.gov>
Committed: Wed Oct 21 18:30:05 2015 -0700

----------------------------------------------------------------------
 ocw/dataset_processor.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/dec62d2e/ocw/dataset_processor.py
----------------------------------------------------------------------
diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py
index 8aebab5..90e644e 100755
--- a/ocw/dataset_processor.py
+++ b/ocw/dataset_processor.py
@@ -160,7 +160,7 @@ def temporal_rebin_with_time_index(target_dataset, nt_average):
     # nt2 is the length of time dimension in the rebinned dataset
     nt2 = nt/nt_average
     binned_dates = target_dataset.times[np.arange(nt2)*nt_average]
-    binned_values = np.zeros(np.insert(target_dataset.values.shape[1:],0,nt2))
+    binned_values = ma.zeros(np.insert(target_dataset.values.shape[1:],0,nt2))
     for it in np.arange(nt2):
         binned_values[it,:] = ma.average(target_dataset.values[nt_average*it:nt_average*it+nt_average,:],
axis=0)
     new_dataset = ds.Dataset(target_dataset.lats,


Mime
View raw message