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 2014/02/08 22:00:16 UTC

svn commit: r1566124 - /incubator/climate/trunk/ocw-ui/backend/processing.py

Author: joyce
Date: Sat Feb  8 21:00:16 2014
New Revision: 1566124

URL: http://svn.apache.org/r1566124
Log:
CLIMATE-332 - Add temporal re-binning to evaluation

Modified:
    incubator/climate/trunk/ocw-ui/backend/processing.py

Modified: incubator/climate/trunk/ocw-ui/backend/processing.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/processing.py?rev=1566124&r1=1566123&r2=1566124&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/processing.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/processing.py Sat Feb  8 21:00:16 2014
@@ -19,12 +19,13 @@
 
 import sys
 from ast import literal_eval
+from datetime import timedelta
 
 from bottle import Bottle, request
 
 import ocw.data_source.local as local
 import ocw.data_source.rcmed as rcmed
-import ocw.dataset_processor as dst
+import ocw.dataset_processor as dsp
 from ocw.evaluation import Evaluation
 import ocw.metrics as metrics
 
@@ -126,6 +127,9 @@ def run_evaluation():
     target_datasets = [_process_dataset_object(obj, eval_bounds) for obj in target_objects]
 
     # Do temporal re-bin based off of passed resolution
+    time_delta = timedelta(days=request.query['temporal_resolution'])
+    ref_dataset = dsp.temporal_rebin(ref_dataset, time_delta)
+    target_datasets = [dsp.temporal_rebin(ds, time_delta) for ds in target_datasets]
 
     # Do spatial re=bin based off of reference dataset + lat/lon steps
     lat_step = request.query['lat_degree_step']