Examples that use dataset_processor.temporal_rebin have been updated
Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/09c01813 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/09c01813 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/09c01813 Branch: refs/heads/master Commit: 09c018135a935f6552e8ee262bd20faed07e3d56 Parents: 3fec482 Author: huikyole <[email protected]> Authored: Fri Jan 29 16:08:07 2016 -0800 Committer: huikyole <[email protected]> Committed: Fri Jan 29 16:08:07 2016 -0800 ---------------------------------------------------------------------- RCMES/test/test.py | 6 +++--- examples/knmi_to_cru31_full_bias.py | 6 +++--- examples/model_ensemble_to_rcmed.py | 8 ++++---- examples/multi_model_taylor_diagram.py | 4 ++-- examples/simple_model_to_model_bias.py | 4 ++-- examples/taylor_diagram_example.py | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/RCMES/test/test.py ---------------------------------------------------------------------- diff --git a/RCMES/test/test.py b/RCMES/test/test.py index beab16f..bbb8095 100644 --- a/RCMES/test/test.py +++ b/RCMES/test/test.py @@ -118,9 +118,9 @@ print("CRU31_Dataset.values shape: (times, lats, lons) - %s" % (cru31_dataset.va print("KNMI_Dataset.values shape: (times, lats, lons) - %s \n" % (knmi_dataset.values.shape,)) print("Temporally Rebinning the Datasets to a Single Timestep") -# To run FULL temporal Rebinning use a timedelta > 366 days. I used 999 in this example -knmi_dataset = dsp.temporal_rebin(knmi_dataset, datetime.timedelta(days=999)) -cru31_dataset = dsp.temporal_rebin(cru31_dataset, datetime.timedelta(days=999)) +# To run FULL temporal Rebinning, +knmi_dataset = dsp.temporal_rebin(knmi_dataset, temporal_resolution='full') +cru31_dataset = dsp.temporal_rebin(cru31_dataset, temporal_resolution='full') print("KNMI_Dataset.values shape: %s" % (knmi_dataset.values.shape,)) print("CRU31_Dataset.values shape: %s \n\n" % (cru31_dataset.values.shape,)) http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/examples/knmi_to_cru31_full_bias.py ---------------------------------------------------------------------- diff --git a/examples/knmi_to_cru31_full_bias.py b/examples/knmi_to_cru31_full_bias.py index beab16f..e37e887 100644 --- a/examples/knmi_to_cru31_full_bias.py +++ b/examples/knmi_to_cru31_full_bias.py @@ -118,9 +118,9 @@ print("CRU31_Dataset.values shape: (times, lats, lons) - %s" % (cru31_dataset.va print("KNMI_Dataset.values shape: (times, lats, lons) - %s \n" % (knmi_dataset.values.shape,)) print("Temporally Rebinning the Datasets to a Single Timestep") -# To run FULL temporal Rebinning use a timedelta > 366 days. I used 999 in this example -knmi_dataset = dsp.temporal_rebin(knmi_dataset, datetime.timedelta(days=999)) -cru31_dataset = dsp.temporal_rebin(cru31_dataset, datetime.timedelta(days=999)) +# To run FULL temporal Rebinning +knmi_dataset = dsp.temporal_rebin(knmi_dataset, temporal_resolution = 'full') +cru31_dataset = dsp.temporal_rebin(cru31_dataset, temporal_resolution = 'full') print("KNMI_Dataset.values shape: %s" % (knmi_dataset.values.shape,)) print("CRU31_Dataset.values shape: %s \n\n" % (cru31_dataset.values.shape,)) http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/examples/model_ensemble_to_rcmed.py ---------------------------------------------------------------------- diff --git a/examples/model_ensemble_to_rcmed.py b/examples/model_ensemble_to_rcmed.py index 45ab599..a9303dd 100644 --- a/examples/model_ensemble_to_rcmed.py +++ b/examples/model_ensemble_to_rcmed.py @@ -120,10 +120,10 @@ cru31_dataset = rcmed.parameter_dataset(dataset_id, """ Step 3: Resample Datasets so they are the same shape """ print("Temporally Rebinning the Datasets to an Annual Timestep") -# To run annual temporal Rebinning use a timedelta of 360 days. -knmi_dataset = dsp.temporal_rebin(knmi_dataset, datetime.timedelta(days=360)) -wrf311_dataset = dsp.temporal_rebin(wrf311_dataset, datetime.timedelta(days=360)) -cru31_dataset = dsp.temporal_rebin(cru31_dataset, datetime.timedelta(days=360)) +# To run annual temporal Rebinning, +knmi_dataset = dsp.temporal_rebin(knmi_dataset, temporal_resolution = 'annual') +wrf311_dataset = dsp.temporal_rebin(wrf311_dataset, temporal_resolution = 'annual') +cru31_dataset = dsp.temporal_rebin(cru31_dataset, temporal_resolution = 'annual') # Running Temporal Rebin early helps negate the issue of datasets being on different # days of the month (1st vs. 15th) http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/examples/multi_model_taylor_diagram.py ---------------------------------------------------------------------- diff --git a/examples/multi_model_taylor_diagram.py b/examples/multi_model_taylor_diagram.py index 48fc736..57dabdd 100644 --- a/examples/multi_model_taylor_diagram.py +++ b/examples/multi_model_taylor_diagram.py @@ -81,11 +81,11 @@ print("Resampling datasets ...") print("... on units") CRU31 = dsp.water_flux_unit_conversion(CRU31) print("... temporal") -CRU31 = dsp.temporal_rebin(CRU31, datetime.timedelta(days=30)) +CRU31 = dsp.temporal_rebin(CRU31, temporal_resolution = 'monthly') for member, each_target_dataset in enumerate(target_datasets): target_datasets[member] = dsp.water_flux_unit_conversion(target_datasets[member]) - target_datasets[member] = dsp.temporal_rebin(target_datasets[member], datetime.timedelta(days=30)) + target_datasets[member] = dsp.temporal_rebin(target_datasets[member], temporal_resolution = 'monthly') target_datasets[member] = dsp.subset(EVAL_BOUNDS, target_datasets[member]) #Regrid http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/examples/simple_model_to_model_bias.py ---------------------------------------------------------------------- diff --git a/examples/simple_model_to_model_bias.py b/examples/simple_model_to_model_bias.py index 635e872..44d482b 100644 --- a/examples/simple_model_to_model_bias.py +++ b/examples/simple_model_to_model_bias.py @@ -54,8 +54,8 @@ print("WRF_Dataset.values shape: (times, lats, lons) - %s \n" % (wrf_dataset.val """ Step 2: Temporally Rebin the Data into an Annual Timestep """ print("Temporally Rebinning the Datasets to an Annual Timestep") -knmi_dataset = dsp.temporal_rebin(knmi_dataset, datetime.timedelta(days=365)) -wrf_dataset = dsp.temporal_rebin(wrf_dataset, datetime.timedelta(days=365)) +knmi_dataset = dsp.temporal_rebin(knmi_dataset, temporal_resolution='annual') +wrf_dataset = dsp.temporal_rebin(wrf_dataset, temporal_resolution='annual') print("KNMI_Dataset.values shape: %s" % (knmi_dataset.values.shape,)) print("WRF_Dataset.values shape: %s \n\n" % (wrf_dataset.values.shape,)) http://git-wip-us.apache.org/repos/asf/climate/blob/09c01813/examples/taylor_diagram_example.py ---------------------------------------------------------------------- diff --git a/examples/taylor_diagram_example.py b/examples/taylor_diagram_example.py index 4ed803e..90c6708 100644 --- a/examples/taylor_diagram_example.py +++ b/examples/taylor_diagram_example.py @@ -67,8 +67,8 @@ wrf_dataset = dsp.subset(subset, wrf_dataset) # Temporally re-bin the data into a monthly timestep. ################################################################################ -knmi_dataset = dsp.temporal_rebin(knmi_dataset, datetime.timedelta(days=30)) -wrf_dataset = dsp.temporal_rebin(wrf_dataset, datetime.timedelta(days=30)) +knmi_dataset = dsp.temporal_rebin(knmi_dataset, temporal_resolution = 'monthly') +wrf_dataset = dsp.temporal_rebin(wrf_dataset, temporal_resolution = 'monthly') # Spatially regrid the datasets onto a 1 degree grid. ################################################################################
