You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/08/15 00:42:54 UTC

svn commit: r1514080 - /incubator/climate/branches/RefactorInput/ocw/dataset_processor.py

Author: joyce
Date: Wed Aug 14 22:42:53 2013
New Revision: 1514080

URL: http://svn.apache.org/r1514080
Log:
CLIMATE-237 - Initial work on helper for slicing Dataset arrays

Modified:
    incubator/climate/branches/RefactorInput/ocw/dataset_processor.py

Modified: incubator/climate/branches/RefactorInput/ocw/dataset_processor.py
URL: http://svn.apache.org/viewvc/incubator/climate/branches/RefactorInput/ocw/dataset_processor.py?rev=1514080&r1=1514079&r2=1514080&view=diff
==============================================================================
--- incubator/climate/branches/RefactorInput/ocw/dataset_processor.py (original)
+++ incubator/climate/branches/RefactorInput/ocw/dataset_processor.py Wed Aug 14 22:42:53 2013
@@ -151,6 +151,7 @@ def subset(subregion, target_dataset):
     # Ensure that the subregion information is well formed
     _check_validity_of_subregion(subregion, target_dataset)
     # Get subregion indices into subregion data
+    dataset_slices = _get_subregion_slice_indices(subregion, target_dataset)
     # Build new dataset with subset information
 
 def _rcmes_spatial_regrid(spatial_values, lat, lon, lat2, lon2, order=1):
@@ -632,3 +633,16 @@ def _is_subregion_contained_by_dataset(s
         lonMin <= subregion.lonMin <= lonMax and
         lonMin <= subregion.lonMax <= lonMax
     )
+
+def _get_subregion_slice_indices(subregion, target_dataset):
+    '''Get the indices for slicing Dataset values to generate the subregion.
+
+    :param subregion: The subregion object that specifies the subset of
+        the Dataset that should be extracted.
+    :type subregion: Dictionary
+    :param target_dataset: The Dataset to subset.
+    :type target_dataset: Dataset
+
+    :returns: The indices to slice the Datasets arrays as a Dictionary.
+    '''
+    pass