climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [1/3] climate git commit: CLIMATE-779 Add capability to run_RCMES.py to integrate ESGF observation and model data
Date Wed, 13 Apr 2016 21:10:23 GMT
Repository: climate
Updated Branches:
  refs/heads/master a7ee20375 -> 1240ee2d5


CLIMATE-779 Add capability to run_RCMES.py to integrate ESGF observation and model data


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

Branch: refs/heads/master
Commit: c19dcec530014f8b3abb51a2e04abc0eddfec6a9
Parents: 584ee86
Author: Nash <deanna.l.nash@jpl.nasa.gov>
Authored: Fri Apr 8 13:19:52 2016 -0700
Committer: Nash <deanna.l.nash@jpl.nasa.gov>
Committed: Fri Apr 8 13:19:52 2016 -0700

----------------------------------------------------------------------
 .../ESGF_example/ESGF-Example.yaml              | 47 ++++++++++++++++++++
 RCMES/run_RCMES.py                              | 17 ++++++-
 2 files changed, 62 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/c19dcec5/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml b/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml
new file mode 100644
index 0000000..ace7d12
--- /dev/null
+++ b/RCMES/configuration_files/ESGF_example/ESGF-Example.yaml
@@ -0,0 +1,47 @@
+workdir: ./results/ESGF_example                                   
+output_netcdf_filename: narccap_zos_annual_mean_1993-2002.nc
+
+# (RCMES will temporally subset data between month_start and month_end. If average_each_year
is True (False), seasonal mean in each year is (not) calculated and used for metrics calculation.)
+time:
+    maximum_overlap_period: False
+    start_time: 1995-01-01
+    end_time: 2003-12-31
+    temporal_resolution: monthly
+    month_start: 3
+    month_end: 9
+    average_each_year: False  
+
+space:
+    min_lat: 10
+    max_lat: 30
+    min_lon: -100
+    max_lon: -60
+
+regrid:
+    regrid_on_reference: True
+    regrid_dlat: 0.50
+    regrid_dlon: 0.50
+
+datasets:
+    reference:
+        data_source: ESGF
+        data_name: obs4MIPS
+        dataset_id: obs4MIPs.CNES.AVISO.zos.mon.v20110829|esgf-data.jpl.nasa.gov        
                 
+        variable: zos
+
+    targets:
+        data_source: ESGF
+        dataset_id: cmip5.output1.MPI-M.MPI-ESM-LR.decadal1994.mon.ocean.Omon.r1i1p1.v20120529|esgf1.dkrz.de
                                                
+        variable: zos
+        GCM_data: True
+
+number_of_metrics_and_plots: 1
+
+metrics1: Map_plot_bias_of_multiyear_climatology
+
+plots1:
+    file_name: BIAS_aviso-NARCCAP_1993-2002_ESGF
+    subplots_array: !!python/tuple [2,2]
+
+
+use_subregions: False

http://git-wip-us.apache.org/repos/asf/climate/blob/c19dcec5/RCMES/run_RCMES.py
----------------------------------------------------------------------
diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py
index 4500fb6..4e5113a 100644
--- a/RCMES/run_RCMES.py
+++ b/RCMES/run_RCMES.py
@@ -76,9 +76,16 @@ elif ref_data_info['data_source'] == 'rcmed':
                                             ref_data_info['parameter_id'],
                                             min_lat, max_lat, min_lon, max_lon,
                                             start_time, end_time)
+elif ref_data_info['data_source'] == 'ESGF':
+      username=raw_input('Enter your ESGF OpenID:\n')
+      password=raw_input('Enter your ESGF password:\n')
+      ds = esgf.load_dataset(dataset_id = ref_data_info['dataset_id'],
+                             variable = ref_data_info['variable'],
+                             esgf_username=username,
+                             esgf_password=password)
+      ref_dataset = ds[0]
 else:
     print ' '
-    # TO DO: support ESGF
 if temporal_resolution == 'daily' or temporal_resolution == 'monthly':
     ref_dataset =  dsp.normalize_dataset_datetimes(ref_dataset, temporal_resolution)
 if 'multiplying_factor' in ref_data_info.keys():
@@ -101,9 +108,15 @@ if model_data_info['data_source'] == 'local':
     model_datasets, model_names = local.load_multiple_files(file_path = model_data_info['path'],
                                                             variable_name =model_data_info['variable'],

                                                             lat_name=model_lat_name, lon_name=model_lon_name)
+elif model_data_info['data_source'] == 'ESGF':
+      md = esgf.load_dataset(dataset_id=model_data_info['dataset_id'],
+                             variable=model_data_info['variable'],
+                             esgf_username=username,
+                             esgf_password=password)
+      model_datasets, model_names = md[0]
 else:
     print ' '
-    # TO DO: support RCMED and ESGF
+    # TO DO: support RCMED
 if temporal_resolution == 'daily' or temporal_resolution == 'monthly':
     for idata,dataset in enumerate(model_datasets):
         model_datasets[idata] = dsp.normalize_dataset_datetimes(dataset, temporal_resolution)


Mime
View raw message