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 2015/10/22 09:15:40 UTC
[1/3] climate git commit: CLIMATE-698 - Handling missing values in
ocw.dataset_processor.temporal_rebin_with_time_index
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 <hu...@argo.jpl.nasa.gov>
Authored: Wed Oct 21 18:30:05 2015 -0700
Committer: huikyole <hu...@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,
[3/3] climate git commit: CLIMATE-698 - Handling missing values in
ocw.dataset_processor.temporal_rebin_with_time_index
Posted by hu...@apache.org.
CLIMATE-698 - Handling missing values in ocw.dataset_processor.temporal_rebin_with_time_index
- the previous merge conflict, CLIMATE-687, has been resolved.
- 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/ca936864
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/ca936864
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/ca936864
Branch: refs/heads/master
Commit: ca9368645056c11f9069391063519c2aa4f80a11
Parents: f4e7bd6 6abd0a9
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Thu Oct 22 00:13:50 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Thu Oct 22 00:13:50 2015 -0700
----------------------------------------------------------------------
ocw/data_source/local.py | 44 +++++++++++++++++++++++--------------------
ocw/dataset_processor.py | 2 +-
2 files changed, 25 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
[2/3] climate git commit: data_source.local.load_GPM_IMERG_files -
the previous merge conflict is resolved
Posted by hu...@apache.org.
data_source.local.load_GPM_IMERG_files - the previous merge conflict is resolved
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/6abd0a95
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/6abd0a95
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/6abd0a95
Branch: refs/heads/master
Commit: 6abd0a95b4eb019d4a81d772d09810ba89d5277d
Parents: dec62d2
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Wed Oct 21 18:43:14 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Wed Oct 21 18:43:14 2015 -0700
----------------------------------------------------------------------
ocw/data_source/local.py | 44 +++++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/6abd0a95/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index 9c1d059..34738ac 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -342,7 +342,6 @@ def load_multiple_files(file_path,
return datasets, data_name
-<<<<<<< HEAD
def load_WRF_2d_files_RAIN(file_path=None,
filename_pattern=None,
filelist=None,
@@ -493,26 +492,10 @@ def load_NLDAS_forcingA_files(file_path=None,
:param filelist: A list of filenames
:type filelist: :list:`string`
:param variable_name: The variable name to load from the NetCDF file.
-=======
-def load_GPM_IMERG_files(file_path=None,
- filename_pattern=None,
- filelist=None,
- variable_name='precipitationCal',
- name='GPM_IMERG'):
- ''' Load multiple GPM Level 3 IMEGE files containing calibrated precipitation and generate an OCW Dataset obejct.
- :param file_path: Directory to the HDF files to load.
- :type file_path: :mod:`string`
- :param filename_pattern: Path to the HDF files to load.
- :type filename_pattern: :list:`string`
- :param filelist: A list of filenames
- :type filelist: :list:`string`
- :param variable_name: The variable name to load from the HDF file.
->>>>>>> CLIMATE-687
:type variable_name: :mod:`string`
:param name: (Optional) A name for the loaded dataset.
:type name: :mod:`string`
:returns: An OCW Dataset object with the requested variable's data from
-<<<<<<< HEAD
the NetCDF file.
:rtype: :class:`dataset.Dataset`
:raises ValueError:
@@ -545,7 +528,29 @@ def load_GPM_IMERG_files(file_path=None,
if ifile == 0:
values = values0
variable_unit = file_object.variables[variable_name].units
-=======
+ else:
+ values = numpy.concatenate((values, values0))
+ file_object.close()
+ times = numpy.array(times)
+ return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)
+
+def load_GPM_IMERG_files(file_path=None,
+ filename_pattern=None,
+ filelist=None,
+ variable_name='precipitationCal',
+ name='GPM_IMERG'):
+ ''' Load multiple GPM Level 3 IMEGE files containing calibrated precipitation and generate an OCW Dataset obejct.
+ :param file_path: Directory to the HDF files to load.
+ :type file_path: :mod:`string`
+ :param filename_pattern: Path to the HDF files to load.
+ :type filename_pattern: :list:`string`
+ :param filelist: A list of filenames
+ :type filelist: :list:`string`
+ :param variable_name: The variable name to load from the HDF file.
+ :type variable_name: :mod:`string`
+ :param name: (Optional) A name for the loaded dataset.
+ :type name: :mod:`string`
+ :returns: An OCW Dataset object with the requested variable's data from
the HDF file.
:rtype: :class:`dataset.Dataset`
:raises ValueError:
@@ -579,9 +584,8 @@ def load_GPM_IMERG_files(file_path=None,
values0= numpy.expand_dims(values0, axis=0)
if ifile == 0:
values = values0
->>>>>>> CLIMATE-687
else:
values = numpy.concatenate((values, values0))
file_object.close()
times = numpy.array(times)
- return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)
+ return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)