climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1566124 - /incubator/climate/trunk/ocw-ui/backend/processing.py
Date Sat, 08 Feb 2014 21:00:16 GMT
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']



Mime
View raw message