You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2017/09/27 21:39:48 UTC

[1/6] climate git commit: Allow acronyms for CORDEX domains

Repository: climate
Updated Branches:
  refs/heads/master ba93542a7 -> 3539aa2be


Allow acronyms for CORDEX domains


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

Branch: refs/heads/master
Commit: d868be10eb3862798f456e45e5ae2d3687dd401c
Parents: ba93542
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:03:09 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:03:09 2017 -0700

----------------------------------------------------------------------
 ocw/utils.py | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/d868be10/ocw/utils.py
----------------------------------------------------------------------
diff --git a/ocw/utils.py b/ocw/utils.py
index db4b926..0a798b0 100755
--- a/ocw/utils.py
+++ b/ocw/utils.py
@@ -505,33 +505,33 @@ def CORDEX_boundary(domain_name):
     :param domain_name: CORDEX domain name (http://www.cordex.org/)
     :type domain_name: :mod:'string'
     '''
-    if domain_name == 'southamerica':
+    if domain_name == 'southamerica' or domain_name == 'SAM':
         return -57.61, 18.50, 254.28 - 360., 343.02 - 360.
-    elif domain_name == 'centralamerica':
+    elif domain_name == 'centralamerica' or domain_name == 'CAM':
         return -19.46, 34.83, 235.74 - 360., 337.78 - 360.
-    elif domain_name == 'northamerica':
+    elif domain_name == 'northamerica' or domain_name == 'NAM':
         return 12.55, 75.88, 189.26 - 360., 336.74 - 360.
-    elif domain_name == 'europe':
+    elif domain_name == 'europe' or domain_name == 'EUR':
         return 22.20, 71.84, 338.23 - 360., 64.4
-    elif domain_name == 'africa':
+    elif domain_name == 'africa' or domain_name == 'AFR':
         return -45.76, 42.24, 335.36 - 360., 60.28
-    elif domain_name == 'southasia':
+    elif domain_name == 'southasia' or domain_name == 'WAS':
         return -15.23, 45.07, 19.88, 115.55
-    elif domain_name == 'eastasia':
+    elif domain_name == 'eastasia' or domain_name == 'EAS':
         return -0.10, 61.90, 51.59, 179.99
-    elif domain_name == 'centralasia':
+    elif domain_name == 'centralasia' or domain_name == 'CAS':
         return 18.34, 69.37, 11.05, 139.13
-    elif domain_name == 'australasia':
+    elif domain_name == 'australasia' or domain_name == 'AUS':
         return -52.36, 12.21, 89.25, 179.99
-    elif domain_name == 'antartica':
+    elif domain_name == 'antartica' or domain_name == 'ANT':
         return -89.48, -56.00, -179.00, 179.00
-    elif domain_name == 'artic':
+    elif domain_name == 'artic' or domain_name == 'ARC':
         return 46.06, 89.50, -179.00, 179.00
-    elif domain_name == 'mediterranean':
+    elif domain_name == 'mediterranean' or domain_name == 'MED':
         return 25.63, 56.66, 339.79 - 360.00, 50.85
-    elif domain_name == 'middleeastnorthafrica':
+    elif domain_name == 'middleeastnorthafrica' or domain_name == 'MNA':
         return -7.00, 45.00, 333.00 - 360.00, 76.00
-    elif domain_name == 'southeastasia':
+    elif domain_name == 'southeastasia' or domain_name == 'SEA':
         return -15.14, 27.26, 89.26, 146.96
     else:
         err = "Invalid CORDEX domain name"
@@ -627,7 +627,7 @@ def _force_unicode(s, encoding='utf-8'):
     '''
     if hasattr(s, 'decode'):
         s = s.decode(encoding=encoding)
-        
+
     return s
 
 def calculate_temporal_trends(dataset):
@@ -649,7 +649,7 @@ def calculate_temporal_trends(dataset):
             if dataset.values[:,iy,ix].count() == nt:
                 trend[iy,ix], slope_err[iy,ix] = calculate_temporal_trend_of_time_series(
                                                x, dataset.values[:,iy,ix])
-    
+
     return ma.masked_equal(trend, -999.), ma.masked_equal(slope_err, -999.)
 
 def calculate_ensemble_temporal_trends(timeseries_array, number_of_samples=1000):
@@ -663,20 +663,20 @@ def calculate_ensemble_temporal_trends(timeseries_array, number_of_samples=1000)
     :returns: temporal trend and estimated error from bootstrapping
     :rtype: :float:`float','float'
     '''
-   
+
     nmodels, nt = timeseries_array.shape
     x = np.arange(nt)
     sampled_trend = np.zeros(number_of_samples)
     ensemble_trend, _ = calculate_temporal_trend_of_time_series(
                         x, np.mean(timeseries_array, axis=0))
-    
+
     for isample in np.arange(number_of_samples):
         index = np.random.choice(nmodels, size=nmodels, replace=True)
         random_ensemble = np.mean(timeseries_array[index, :], axis=0)
         sampled_trend[isample], _ = calculate_temporal_trend_of_time_series(
                                     x, random_ensemble)
     return ensemble_trend, np.std(sampled_trend, ddof=1)
-     
+
 
 def calculate_temporal_trend_of_time_series(x,y):
     ''' Calculate least-square trends (a) in y = ax+b and a's standard error


[4/6] climate git commit: Default values for filename_pattern in split file loader

Posted by go...@apache.org.
Default values for filename_pattern in split file loader


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

Branch: refs/heads/master
Commit: 8168d2042390712f9d58051633d93c267a002756
Parents: eacee1f
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:21:09 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:21:09 2017 -0700

----------------------------------------------------------------------
 ocw/data_source/local.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/8168d204/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index 734b091..896032f 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -508,6 +508,7 @@ def load_dataset_from_multiple_netcdf_files(variable_name, variable_unit=None,
     '''
     nc_files = []
     if not file_list:
+        filename_pattern = [''] if not filename_pattern else filename_pattern
         for pattern in filename_pattern:
             nc_files.extend(glob(file_path + pattern))
     else:


[6/6] climate git commit: CLIMATE-925 - CORDEX Config File Template

Posted by go...@apache.org.
CLIMATE-925 - CORDEX Config File Template


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

Branch: refs/heads/master
Commit: 3539aa2be6408140e33d82fb413089c62fcec70f
Parents: 368e696
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:41:06 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:41:06 2017 -0700

----------------------------------------------------------------------
 RCMES/CORDEX/templates/CORDEX.yaml.template | 57 ++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/3539aa2b/RCMES/CORDEX/templates/CORDEX.yaml.template
----------------------------------------------------------------------
diff --git a/RCMES/CORDEX/templates/CORDEX.yaml.template b/RCMES/CORDEX/templates/CORDEX.yaml.template
new file mode 100644
index 0000000..daf6ec5
--- /dev/null
+++ b/RCMES/CORDEX/templates/CORDEX.yaml.template
@@ -0,0 +1,57 @@
+{% set domain = models_info[0].domain %}
+{% set instrument = obs_info.instrument %}
+{% set variable = obs_info.variable %}
+{% set basename = [variable, instrument, domain, season]|join('_') %}
+workdir: {{ [output_dir, domain, instrument, variable, season]|join('/') }}
+output_netcdf_filename: {{ basename }}.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: True
+    temporal_resolution: monthly
+{% if season == "winter" %}
+    month_start: 12
+    month_end: 2
+{% elif season == "summer" %}
+    month_start: 6
+    month_end: 8
+{% else %}
+    month_start: 1
+    month_end: 12
+{% endif %}
+    average_each_year: True
+
+space:
+    boundary_type: {{ domain[:3] }}
+
+regrid:
+    regrid_on_reference: True
+
+datasets:
+  - loader_name: local_split
+    name: {{ instrument }}
+    file_path: {{ obs_info.filename }}
+    variable_name: {{ variable }}
+{% for model_info in models_info %}
+  - loader_name: local_split
+    name: {{ model_info.model }}
+    file_path: {{ model_info.filename }}
+    variable_name: {{ variable }}
+    lat_name: lat
+    lon_name: lon
+{% endfor %}
+
+number_of_metrics_and_plots: 2
+
+metrics1: Map_plot_bias_of_multiyear_climatology
+
+plots1:
+    file_name: {{ basename }}_bias
+
+metrics2: Taylor_diagram_spatial_pattern_of_multiyear_climatology
+
+plots2:
+    file_name: {{ basename }}_taylor
+
+use_subregions: False


[3/6] climate git commit: Allow acronyms for CORDEX domains

Posted by go...@apache.org.
Allow acronyms for CORDEX domains


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

Branch: refs/heads/master
Commit: eacee1f5a2569a191d4961621d37281ccdf06017
Parents: 3e66d94
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:19:39 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:19:39 2017 -0700

----------------------------------------------------------------------
 RCMES/run_RCMES.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/eacee1f5/RCMES/run_RCMES.py
----------------------------------------------------------------------
diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py
index ba8ef2a..f729f98 100644
--- a/RCMES/run_RCMES.py
+++ b/RCMES/run_RCMES.py
@@ -79,7 +79,10 @@ if not 'boundary_type' in space_info:
     min_lon = space_info['min_lon']
     max_lon = space_info['max_lon']
 else:
-    min_lat, max_lat, min_lon, max_lon = utils.CORDEX_boundary(space_info['boundary_type'][6:].replace(" ","").lower())
+    domain = space_info['boundary_type']
+    if domain.startswith('CORDEX '):
+        domain = domain.replace('CORDEX ', '').lower()
+    min_lat, max_lat, min_lon, max_lon = utils.CORDEX_boundary(domain)
 
 # Additional arguments for the DatasetLoader
 extra_opts = {'min_lat': min_lat, 'max_lat': max_lat, 'min_lon': min_lon,


[5/6] climate git commit: Ignore start and end times when maximum_overlap is True

Posted by go...@apache.org.
Ignore start and end times when maximum_overlap is True


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

Branch: refs/heads/master
Commit: 368e6969ca992e29b7bf49906449c4c92a913d2f
Parents: 8168d20
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:33:14 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:33:14 2017 -0700

----------------------------------------------------------------------
 RCMES/run_RCMES.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/368e6969/RCMES/run_RCMES.py
----------------------------------------------------------------------
diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py
index f729f98..7641299 100644
--- a/RCMES/run_RCMES.py
+++ b/RCMES/run_RCMES.py
@@ -68,8 +68,13 @@ time_info = config['time']
 temporal_resolution = time_info['temporal_resolution']
 
 # Read time info
-start_time = datetime.strptime(time_info['start_time'].strftime('%Y%m%d'),'%Y%m%d')
-end_time = datetime.strptime(time_info['end_time'].strftime('%Y%m%d'),'%Y%m%d')
+maximum_overlap_period = space_info.get('maximum_overlap_period', False)
+if not maximum_overlap_period:
+    start_time = datetime.strptime(time_info['start_time'].strftime('%Y%m%d'),'%Y%m%d')
+    end_time = datetime.strptime(time_info['end_time'].strftime('%Y%m%d'),'%Y%m%d')
+else:
+    # These values will be determined after datasets are loaded
+    start_time, end_time = None, None
 
 # Read space info
 space_info = config['space']
@@ -113,7 +118,7 @@ for i, dataset in enumerate(datasets):
 
 """ Step 2: Subset the data for temporal and spatial domain """
 # Create a Bounds object to use for subsetting
-if time_info['maximum_overlap_period']:
+if maximum_overlap_period:
     start_time, end_time = utils.get_temporal_overlap(datasets)
     print('Maximum overlap period')
     print('start_time: {}'.format(start_time))


[2/6] climate git commit: Default vales for subplot grid in RCMES script

Posted by go...@apache.org.
Default vales for subplot grid in RCMES script


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

Branch: refs/heads/master
Commit: 3e66d94fce1935aac2a8cc88025d50858d78f3ba
Parents: d868be1
Author: Alex <ag...@users.noreply.github.com>
Authored: Tue Sep 26 16:10:44 2017 -0700
Committer: Alex <ag...@users.noreply.github.com>
Committed: Tue Sep 26 16:10:44 2017 -0700

----------------------------------------------------------------------
 RCMES/metrics_and_plots.py | 65 +++++++++++++++++++----------------------
 RCMES/run_RCMES.py         |  8 ++---
 2 files changed, 34 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/3e66d94f/RCMES/metrics_and_plots.py
----------------------------------------------------------------------
diff --git a/RCMES/metrics_and_plots.py b/RCMES/metrics_and_plots.py
index 848af9d..78c2f14 100644
--- a/RCMES/metrics_and_plots.py
+++ b/RCMES/metrics_and_plots.py
@@ -27,7 +27,7 @@ import ocw.metrics as metrics
 import numpy as np
 import numpy.ma as ma
 import matplotlib.pyplot as plt
-from mpl_toolkits.basemap import Basemap 
+from mpl_toolkits.basemap import Basemap
 from matplotlib import rcParams
 from matplotlib.patches import Polygon
 import string
@@ -46,7 +46,7 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
                                  model_datasets, # list of target datasets for the evaluation
                                  [map_of_bias, map_of_bias])
     # run the evaluation (bias calculation)
-    bias_evaluation.run() 
+    bias_evaluation.run()
 
     rcm_bias = bias_evaluation.results[0]
 
@@ -57,7 +57,9 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
     lon_min = obs_dataset.lons.min()
     lon_max = obs_dataset.lons.max()
 
-    string_list = list(string.ascii_lowercase) 
+    string_list = list(string.ascii_lowercase)
+    nmodels = len(model_datasets)
+    row, column = plotter._best_grid_shape((row, column), nmodels + 1)
     ax = fig.add_subplot(row,column,1)
     if map_projection == 'npstere':
         m = Basemap(ax=ax, projection ='npstere', boundinglat=lat_min, lon_0=0,
@@ -79,9 +81,9 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
     max = m.contourf(x,y,obs_clim,levels = plotter._nice_intervals(obs_dataset.values, 10), extend='both',cmap='rainbow')
     ax.annotate('(a) \n' + obs_name,xy=(lon_min, lat_min))
     cax = fig.add_axes([0.02, 1.-float(1./row)+1./row*0.25, 0.01, 1./row*0.5])
-    plt.colorbar(max, cax = cax) 
+    plt.colorbar(max, cax = cax)
     clevs = plotter._nice_intervals(rcm_bias, 11)
-    for imodel in np.arange(len(model_datasets)):
+    for imodel in np.arange(nmodels):
 
         ax = fig.add_subplot(row, column,2+imodel)
         if map_projection == 'npstere':
@@ -97,7 +99,7 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
         ax.annotate('('+string_list[imodel+1]+')  \n '+model_names[imodel],xy=(lon_min, lat_min))
 
     cax = fig.add_axes([0.91, 0.5, 0.015, 0.4])
-    plt.colorbar(max, cax = cax) 
+    plt.colorbar(max, cax = cax)
 
     plt.subplots_adjust(hspace=0.01,wspace=0.05)
 
@@ -122,16 +124,16 @@ def Taylor_diagram_spatial_pattern_of_multiyear_climatology(obs_dataset, obs_nam
                                  [taylor_diagram])
 
     # run the evaluation (bias calculation)
-    taylor_evaluation.run() 
+    taylor_evaluation.run()
 
     taylor_data = taylor_evaluation.results[0]
 
     plotter.draw_taylor_diagram(taylor_data, model_names, obs_name, file_name, pos='upper right',frameon=False)
 
-def Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, seasonal_cycle, 
+def Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, model_names, seasonal_cycle,
                           file_name, row, column, x_tick=['']):
 
-    nmodel, nt, nregion = model_subregion_mean.shape  
+    nmodel, nt, nregion = model_subregion_mean.shape
 
     if seasonal_cycle:
         obs_data = ma.mean(obs_subregion_mean.reshape([1,nt/12,12,nregion]), axis=1)
@@ -140,19 +142,19 @@ def Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, mo
     else:
         obs_data = obs_subregion_mean
         model_data = model_subregion_mean
-        
+
     x_axis = np.arange(nt)
     x_tick_values = x_axis
 
     fig = plt.figure()
     rcParams['xtick.labelsize'] = 6
     rcParams['ytick.labelsize'] = 6
-  
+
     for iregion in np.arange(nregion):
-        ax = fig.add_subplot(row, column, iregion+1) 
+        ax = fig.add_subplot(row, column, iregion+1)
         x_tick_labels = ['']
         if iregion+1  > column*(row-1):
-            x_tick_labels = x_tick 
+            x_tick_labels = x_tick
         else:
             x_tick_labels=['']
         ax.plot(x_axis, obs_data[0, :, iregion], color='r', lw=2, label=obs_name)
@@ -162,8 +164,8 @@ def Time_series_subregion(obs_subregion_mean, obs_name, model_subregion_mean, mo
         ax.set_xticks(x_tick_values)
         ax.set_xticklabels(x_tick_labels)
         ax.set_title('Region %02d' % (iregion+1), fontsize=8)
-    
-    ax.legend(bbox_to_anchor=(-0.2, row/2), loc='center' , prop={'size':7}, frameon=False)  
+
+    ax.legend(bbox_to_anchor=(-0.2, row/2), loc='center' , prop={'size':7}, frameon=False)
 
     fig.subplots_adjust(hspace=0.7, wspace=0.5)
     fig.savefig(file_name, dpi=600, bbox_inches='tight')
@@ -172,7 +174,7 @@ def Portrait_diagram_subregion(obs_subregion_mean, obs_name, model_subregion_mea
                                file_name, normalize=True):
 
     nmodel, nt, nregion = model_subregion_mean.shape
-    
+
     if seasonal_cycle:
         obs_data = ma.mean(obs_subregion_mean.reshape([1,nt/12,12,nregion]), axis=1)
         model_data = ma.mean(model_subregion_mean.reshape([nmodel,nt/12,12,nregion]), axis=1)
@@ -193,35 +195,35 @@ def Portrait_diagram_subregion(obs_subregion_mean, obs_name, model_subregion_mea
             subregion_metrics[2, iregion, imodel] = metrics.calc_rmse(model_data[imodel, :, iregion], obs_data[0, :, iregion])
             # Fourth metric: correlation
             subregion_metrics[3, iregion, imodel] = metrics.calc_correlation(model_data[imodel, :, iregion], obs_data[0, :, iregion])
-   
+
     if normalize:
         for iregion in np.arange(nregion):
-            subregion_metrics[0, iregion, : ] = subregion_metrics[0, iregion, : ]/ma.std(obs_data[0, :, iregion])*100. 
-            subregion_metrics[1, iregion, : ] = subregion_metrics[1, iregion, : ]*100. 
-            subregion_metrics[2, iregion, : ] = subregion_metrics[2, iregion, : ]/ma.std(obs_data[0, :, iregion])*100. 
+            subregion_metrics[0, iregion, : ] = subregion_metrics[0, iregion, : ]/ma.std(obs_data[0, :, iregion])*100.
+            subregion_metrics[1, iregion, : ] = subregion_metrics[1, iregion, : ]*100.
+            subregion_metrics[2, iregion, : ] = subregion_metrics[2, iregion, : ]/ma.std(obs_data[0, :, iregion])*100.
 
     region_names = ['R%02d' % i for i in np.arange(nregion)+1]
 
     for imetric, metric in enumerate(['bias','std','RMSE','corr']):
-        plotter.draw_portrait_diagram(subregion_metrics[imetric, :, :], region_names, model_names, file_name+'_'+metric, 
-                                      xlabel='model',ylabel='region')             
+        plotter.draw_portrait_diagram(subregion_metrics[imetric, :, :], region_names, model_names, file_name+'_'+metric,
+                                      xlabel='model',ylabel='region')
 
 def Map_plot_subregion(subregions, ref_dataset, directory):
-  
-    lons, lats = np.meshgrid(ref_dataset.lons, ref_dataset.lats) 
+
+    lons, lats = np.meshgrid(ref_dataset.lons, ref_dataset.lats)
     fig = plt.figure()
     ax = fig.add_subplot(111)
     m = Basemap(ax=ax, projection='cyl',llcrnrlat = lats.min(), urcrnrlat = lats.max(),
                 llcrnrlon = lons.min(), urcrnrlon = lons.max(), resolution = 'l')
     m.drawcoastlines(linewidth=0.75)
     m.drawcountries(linewidth=0.75)
-    m.etopo()  
-    x, y = m(lons, lats) 
+    m.etopo()
+    x, y = m(lons, lats)
     #subregion_array = ma.masked_equal(subregion_array, 0)
     #max=m.contourf(x, y, subregion_array, alpha=0.7, cmap='Accent')
     for subregion in subregions:
-        draw_screen_poly(subregion[1], m, 'w') 
-        plt.annotate(subregion[0],xy=(0.5*(subregion[1][2]+subregion[1][3]), 0.5*(subregion[1][0]+subregion[1][1])), ha='center',va='center', fontsize=8) 
+        draw_screen_poly(subregion[1], m, 'w')
+        plt.annotate(subregion[0],xy=(0.5*(subregion[1][2]+subregion[1][3]), 0.5*(subregion[1][0]+subregion[1][1])), ha='center',va='center', fontsize=8)
     fig.savefig(directory+'map_subregion', bbox_inches='tight')
 
 def draw_screen_poly(boundary_array, m, linecolor='k'):
@@ -238,10 +240,3 @@ def draw_screen_poly(boundary_array, m, linecolor='k'):
     xy = zip(x,y)
     poly = Polygon( xy, facecolor='none',edgecolor=linecolor )
     plt.gca().add_patch(poly)
-    
-    
-   
-
-    
-
-    

http://git-wip-us.apache.org/repos/asf/climate/blob/3e66d94f/RCMES/run_RCMES.py
----------------------------------------------------------------------
diff --git a/RCMES/run_RCMES.py b/RCMES/run_RCMES.py
index 027d2e2..ba8ef2a 100644
--- a/RCMES/run_RCMES.py
+++ b/RCMES/run_RCMES.py
@@ -94,7 +94,7 @@ data_info = config['datasets']
 # (first) dataset. We should instead make this a parameter for each
 # loader and Dataset objects.
 fact = data_info[0].pop('multiplying_factor', 1)
-    
+
 """ Step 1: Load the datasets """
 print('Loading datasets:\n{}'.format(data_info))
 datasets = load_datasets_from_config(extra_opts, *data_info)
@@ -262,7 +262,7 @@ if nmetrics > 0:
 
         print('metrics {0}/{1}: {2}'.format(imetric, nmetrics, metrics_name))
         if metrics_name == 'Map_plot_bias_of_multiyear_climatology':
-            row, column = plot_info['subplots_array']
+            row, column = plot_info.get('subplots_array', (1, 1))
             if 'map_projection' in plot_info.keys():
                 Map_plot_bias_of_multiyear_climatology(
                     reference_dataset, reference_name, target_datasets, target_names,
@@ -279,7 +279,7 @@ if nmetrics > 0:
         elif config['use_subregions']:
             if (metrics_name == 'Timeseries_plot_subregion_interannual_variability'
                 and average_each_year):
-                row, column = plot_info['subplots_array']
+                row, column = plot_info.get('subplots_array', (1, 1))
                 Time_series_subregion(
                     reference_subregion_mean, reference_name, target_subregion_mean,
                     target_names, False, file_name, row, column,
@@ -288,7 +288,7 @@ if nmetrics > 0:
 
             if (metrics_name == 'Timeseries_plot_subregion_annual_cycle'
                 and not average_each_year and month_start==1 and month_end==12):
-                row, column = plot_info['subplots_array']
+                row, column = plot_info.get('subplots_array', (1, 1))
                 Time_series_subregion(
                     reference_subregion_mean, reference_name,
                     target_subregion_mean, target_names, True,