Repository: climate Updated Branches: refs/heads/master fea37a9be -> 7cfd7e923
get_temporal_overlap moved from ocw.dataset_processor to ocw.utils Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/e3f71eba Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/e3f71eba Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/e3f71eba Branch: refs/heads/master Commit: e3f71eba1c1255e3b0f681f7e7b35956504bfd9f Parents: c032467 Author: huikyole <[email protected]> Authored: Tue Jul 28 23:54:25 2015 -0700 Committer: huikyole <[email protected]> Committed: Tue Jul 28 23:54:25 2015 -0700 ---------------------------------------------------------------------- ocw/dataset_processor.py | 14 -------------- ocw/utils.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/e3f71eba/ocw/dataset_processor.py ---------------------------------------------------------------------- diff --git a/ocw/dataset_processor.py b/ocw/dataset_processor.py index 3e35003..984e142 100755 --- a/ocw/dataset_processor.py +++ b/ocw/dataset_processor.py @@ -114,20 +114,6 @@ def temporal_rebin(target_dataset, temporal_resolution): return new_dataset -def get_temporal_overlap(dataset_array): - ''' Find the maximum temporal overlap across the observation and model datasets - - :param dataset_array: an array of OCW datasets - ''' - start_time =[] - end_time =[] - for dataset in dataset_array: - start_time.append(dataset.time_range()[0]) - end_time.append(dataset.time_range()[1]) - - return np.max(start_time), np.min(end_time) - - def spatial_regrid(target_dataset, new_latitudes, new_longitudes): """ Regrid a Dataset using the new latitudes and longitudes http://git-wip-us.apache.org/repos/asf/climate/blob/e3f71eba/ocw/utils.py ---------------------------------------------------------------------- diff --git a/ocw/utils.py b/ocw/utils.py index bb5ed37..7c7776f 100755 --- a/ocw/utils.py +++ b/ocw/utils.py @@ -343,3 +343,16 @@ def calc_time_series(dataset): t_series.append(dataset.values[t,:,:].mean()) return t_series + +def get_temporal_overlap(dataset_array): + ''' Find the maximum temporal overlap across the observation and model datasets + + :param dataset_array: an array of OCW datasets + ''' + start_time =[] + end_time =[] + for dataset in dataset_array: + start_time.append(dataset.time_range()[0]) + end_time.append(dataset.time_range()[1]) + + return np.max(start_time), np.min(end_time)
