Repository: climate Updated Branches: refs/heads/master 0e55cc15c -> 16f956a10
CLIMATE-869 - Time range bug in dataset_processor.subset - ocw.dataset_processor.subset has been updated with the temporal subset bug fixed Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/493cddfe Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/493cddfe Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/493cddfe Branch: refs/heads/master Commit: 493cddfe98dbceaeaa6dc5a1f46a5569c47dc994 Parents: 677173e Author: huikyole <huiky...@argo.jpl.nasa.gov> Authored: Fri Sep 9 10:53:23 2016 -0700 Committer: huikyole <huiky...@argo.jpl.nasa.gov> Committed: Fri Sep 9 10:53:23 2016 -0700 ---------------------------------------------------------------------- ocw/dataset_processor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/493cddfe/ocw/dataset_processor.py ---------------------------------------------------------------------- diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py index 36e337a..a41b9ce 100755 --- a/ocw/dataset_processor.py +++ b/ocw/dataset_processor.py @@ -397,8 +397,9 @@ def subset(target_dataset, subregion, subregion_name=None, extract=True, user_ma if target_dataset.lats.ndim == 2 and target_dataset.lons.ndim == 2: start_time_index = np.where( - target_dataset.times == subregion.start)[0][0] - end_time_index = np.where(target_dataset.times == subregion.end)[0][0] + target_dataset.times >= subregion.start)[0][0] + end_time_index = np.where( + target_dataset.times <= subregion.end)[0][-1] target_dataset = temporal_slice( target_dataset, start_time_index, end_time_index) nt, ny, nx = target_dataset.values.shape