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 2017/03/08 15:43:47 UTC

[1/3] climate git commit: CLIMATE-898 - Debugging WRF loaders

Repository: climate
Updated Branches:
  refs/heads/master 6634de72c -> 1ecb29555


CLIMATE-898 - Debugging WRF loaders

- ocw.data_source.local.load_WRF_2d_files/load_WRF_2d_files_RAIN have been updated.


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

Branch: refs/heads/master
Commit: 9e79a7f8e73fc477102afa93827ed860e3a515ae
Parents: 6634de7
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Mar 7 21:26:25 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Mar 7 21:26:25 2017 -0800

----------------------------------------------------------------------
 ocw/data_source/local.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/9e79a7f8/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index 66fae9b..044e6cb 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -168,11 +168,14 @@ def load_WRF_2d_files(file_path=None,
             times.append(
                 datetime(*time_struct_parsed[:6]) + timedelta(hours=ihour))
         values0 = file_object.variables[variable_name][:]
+        if isinstance(values0, numpy.ndarray):
+            values0 = ma.array(values0,
+                               mask=numpy.zeros(values0.shape))   
         if ifile == 0:
             values = values0
             variable_unit = file_object.variables[variable_name].units
         else:
-            values = numpy.concatenate((values, values0))
+            values = ma.concatenate((values, values0))
         file_object.close()
     times = numpy.array(times)
     return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)
@@ -407,12 +410,14 @@ def load_WRF_2d_files_RAIN(file_path=None,
         for ihour in range(24):
             times.append(
                 datetime(*time_struct_parsed[:6]) + timedelta(hours=ihour))
+        temp_value = file_object.variables['RAINC'][:] + file_object.variables['RAINNC'][:]
+        if isinstance(temp_value, numpy.ndarray):
+            temp_value = ma.array(temp_value,
+                          mask=numpy.zeros(temp_value.shape))
         if ifile == 0:
-            values0 = file_object.variables['RAINC'][
-                :] + file_object.variables['RAINNC'][:]
+            values0 = temp_value
         else:
-            values0 = numpy.concatenate((values0, file_object.variables['RAINC'][
-                                        :] + file_object.variables['RAINNC'][:]))
+            values0 = numpy.concatenate((values0, temp_value))
         file_object.close()
     times = numpy.array(times)
     years = numpy.array([d.year for d in times])
@@ -420,6 +425,7 @@ def load_WRF_2d_files_RAIN(file_path=None,
     print('ncycle=', ncycle)
     nt, ny, nx = values0.shape
     values = numpy.zeros([nt - ncycle * 24, ny, nx])
+    values = ma.array(values, mask=numpy.zeros(values.shape))
     times2 = []
     nt2 = nt / ncycle
     # remove the first day in each year


[3/3] climate git commit: Merge branch 'CLIMATE-898'

Posted by hu...@apache.org.
Merge branch 'CLIMATE-898'


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

Branch: refs/heads/master
Commit: 1ecb295552b693585fb97f136536801739ee93f0
Parents: 6634de7 c6a9ec1
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Wed Mar 8 07:43:32 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Wed Mar 8 07:43:32 2017 -0800

----------------------------------------------------------------------
 ocw/data_source/local.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[2/3] climate git commit: numpy.concatenate => ma.concatenate

Posted by hu...@apache.org.
numpy.concatenate => ma.concatenate


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

Branch: refs/heads/master
Commit: c6a9ec1edd7e7e276d89367ff4f337bb27205f5a
Parents: 9e79a7f
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Mar 7 21:30:17 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Mar 7 21:30:17 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/climate/blob/c6a9ec1e/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index 044e6cb..9801d8a 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -417,7 +417,7 @@ def load_WRF_2d_files_RAIN(file_path=None,
         if ifile == 0:
             values0 = temp_value
         else:
-            values0 = numpy.concatenate((values0, temp_value))
+            values0 = ma.concatenate((values0, temp_value))
         file_object.close()
     times = numpy.array(times)
     years = numpy.array([d.year for d in times])