You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2017/09/27 21:39:52 UTC

[5/6] climate git commit: Ignore start and end times when maximum_overlap is True

Ignore start and end times when maximum_overlap is True


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

Branch: refs/heads/master
Commit: 368e6969ca992e29b7bf49906449c4c92a913d2f
Parents: 8168d20
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:33:14 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:33:14 2017 -0700

----------------------------------------------------------------------
 RCMES/run_RCMES.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/368e6969/RCMES/run_RCMES.py
----------------------------------------------------------------------
diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py
index f729f98..7641299 100644
--- a/RCMES/run_RCMES.py
+++ b/RCMES/run_RCMES.py
@@ -68,8 +68,13 @@ time_info = config['time']
 temporal_resolution = time_info['temporal_resolution']
 
 # Read time info
-start_time = datetime.strptime(time_info['start_time'].strftime('%Y%m%d'),'%Y%m%d')
-end_time = datetime.strptime(time_info['end_time'].strftime('%Y%m%d'),'%Y%m%d')
+maximum_overlap_period = space_info.get('maximum_overlap_period', False)
+if not maximum_overlap_period:
+    start_time = datetime.strptime(time_info['start_time'].strftime('%Y%m%d'),'%Y%m%d')
+    end_time = datetime.strptime(time_info['end_time'].strftime('%Y%m%d'),'%Y%m%d')
+else:
+    # These values will be determined after datasets are loaded
+    start_time, end_time = None, None
 
 # Read space info
 space_info = config['space']
@@ -113,7 +118,7 @@ for i, dataset in enumerate(datasets):
 
 """ Step 2: Subset the data for temporal and spatial domain """
 # Create a Bounds object to use for subsetting
-if time_info['maximum_overlap_period']:
+if maximum_overlap_period:
     start_time, end_time = utils.get_temporal_overlap(datasets)
     print('Maximum overlap period')
     print('start_time: {}'.format(start_time))