climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [1/2] climate git commit: CLIMATE-749 - Changing temporal_resolution key in CLI
Date Wed, 03 Feb 2016 19:18:57 GMT
Repository: climate
Updated Branches:
  refs/heads/master d34caaea5 -> bd5ab80ab


CLIMATE-749 - Changing temporal_resolution key in CLI

- This is a follow up of the previous ticket, CLIMATE-732. CLI now uses correct keys when
calling dataset_processor.temporal_rebin.


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

Branch: refs/heads/master
Commit: 97f9824d2e41c2ea610c9b2c574c5d84575a3aed
Parents: d34caae
Author: huikyole <huikyole@argo.jpl.nasa.gov>
Authored: Wed Feb 3 11:14:12 2016 -0800
Committer: huikyole <huikyole@argo.jpl.nasa.gov>
Committed: Wed Feb 3 11:14:12 2016 -0800

----------------------------------------------------------------------
 RCMES/cli_app.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/97f9824d/RCMES/cli_app.py
----------------------------------------------------------------------
diff --git a/RCMES/cli_app.py b/RCMES/cli_app.py
index 60f5219..4aaaad4 100644
--- a/RCMES/cli_app.py
+++ b/RCMES/cli_app.py
@@ -586,19 +586,11 @@ def run_screen(model_datasets, models_info, observations_info,
 
              screen.addstr(5, 4, "Temporally regridding...")
              screen.refresh()
-             if temp_grid_setting.lower() == 'hourly':
-                  days = 0.5
-             elif temp_grid_setting.lower() == 'daily':
-                  days = 1
-             elif temp_grid_setting.lower() == 'monthly':
-                  days = 31
-             else:
-                  days = 365
              for i in range(len(obs_dataset)):
-                  obs_dataset[i] = dsp.temporal_rebin(obs_dataset[i], timedelta(days))
+                  obs_dataset[i] = dsp.temporal_rebin(obs_dataset[i], temp_grid_setting.lower())
 
              for member, each_target_dataset in enumerate(new_model_datasets):
-                  new_model_datasets[member] = dsp.temporal_rebin(new_model_datasets[member],
timedelta(days))
+                  new_model_datasets[member] = dsp.temporal_rebin(new_model_datasets[member],
temp_grid_setting.lower())
                   if each_target_dataset.lats.ndim !=2 and each_target_dataset.lons.ndim
!=2:
                       new_model_datasets[member] = dsp.subset(EVAL_BOUNDS, new_model_datasets[member])
                   else:


Mime
View raw message