You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2015/10/22 02:57:40 UTC

[1/3] climate git commit: CLIMATE-696 - Examples to evaluate CORDEX-ARCTIC RCMs

Repository: climate
Updated Branches:
  refs/heads/master 360b5728f -> f4e7bd61c


CLIMATE-696 - Examples to evaluate CORDEX-ARCTIC RCMs

- run_RCMES.py and metrics_and_plots 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/a94d3b1e
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/a94d3b1e
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/a94d3b1e

Branch: refs/heads/master
Commit: a94d3b1ec3d4cce49817f2fdab831cef7c39aeb9
Parents: a38724e
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Sat Oct 17 16:37:42 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Sat Oct 17 16:37:42 2015 -0700

----------------------------------------------------------------------
 .../configuration_file_examples/metrics_and_plots.py  | 14 +++++++++++---
 examples/configuration_file_examples/run_RCMES.py     | 11 +++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/a94d3b1e/examples/configuration_file_examples/metrics_and_plots.py
----------------------------------------------------------------------
diff --git a/examples/configuration_file_examples/metrics_and_plots.py b/examples/configuration_file_examples/metrics_and_plots.py
index f32446c..41e0d14 100644
--- a/examples/configuration_file_examples/metrics_and_plots.py
+++ b/examples/configuration_file_examples/metrics_and_plots.py
@@ -15,7 +15,7 @@ from matplotlib.patches import Polygon
 import string
 
 def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets, model_names,
-                                      file_name, row, column):
+                                      file_name, row, column, map_projection=None):
     '''Draw maps of observed multi-year climatology and biases of models"'''
 
     # calculate climatology of observation data
@@ -42,7 +42,11 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
 
     string_list = list(string.ascii_lowercase) 
     ax = fig.add_subplot(row,column,1)
-    m = Basemap(ax=ax, projection ='cyl', llcrnrlat = lat_min, urcrnrlat = lat_max,
+    if map_projection == 'npstere':
+        m = Basemap(ax=ax, projection ='npstere', boundinglat=lat_min, lon_0=0,
+            resolution = 'l', fix_aspect=False)
+    else:
+        m = Basemap(ax=ax, projection ='cyl', llcrnrlat = lat_min, urcrnrlat = lat_max,
             llcrnrlon = lon_min, urcrnrlon = lon_max, resolution = 'l', fix_aspect=False)
     lons, lats = np.meshgrid(obs_dataset.lons, obs_dataset.lats)
 
@@ -58,7 +62,11 @@ def Map_plot_bias_of_multiyear_climatology(obs_dataset, obs_name, model_datasets
     clevs = plotter._nice_intervals(rcm_bias, 11)
     for imodel in np.arange(len(model_datasets)):
         ax = fig.add_subplot(row, column,2+imodel)
-        m = Basemap(ax=ax, projection ='cyl', llcrnrlat = lat_min, urcrnrlat = lat_max,
+        if map_projection == 'npstere':
+            m = Basemap(ax=ax, projection ='npstere', boundinglat=lat_min, lon_0=0,
+                resolution = 'l', fix_aspect=False)
+        else:
+            m = Basemap(ax=ax, projection ='cyl', llcrnrlat = lat_min, urcrnrlat = lat_max,
                 llcrnrlon = lon_min, urcrnrlon = lon_max, resolution = 'l', fix_aspect=False)
         m.drawcoastlines(linewidth=1)
         m.drawcountries(linewidth=1)

http://git-wip-us.apache.org/repos/asf/climate/blob/a94d3b1e/examples/configuration_file_examples/run_RCMES.py
----------------------------------------------------------------------
diff --git a/examples/configuration_file_examples/run_RCMES.py b/examples/configuration_file_examples/run_RCMES.py
index d32c7af..5f15dfe 100644
--- a/examples/configuration_file_examples/run_RCMES.py
+++ b/examples/configuration_file_examples/run_RCMES.py
@@ -8,6 +8,7 @@ from ocw.dataset import Bounds
 
 import matplotlib.pyplot as plt
 from matplotlib import rcParams
+from mpl_toolkits.basemap import shiftgrid
 import numpy as np
 import numpy.ma as ma
 import yaml
@@ -57,6 +58,8 @@ else:
     # TO DO: support ESGF
 
 ref_dataset =  dsp.normalize_dataset_datetimes(ref_dataset, temporal_resolution)
+if 'multiplying_factor' in ref_data_info.keys():
+    ref_dataset.values = ref_dataset.values*ref_data_info['multiplying_factor']
 
 """ Step 2: Load model NetCDF Files into OCW Dataset Objects """
 model_data_info = config['datasets']['targets']
@@ -191,8 +194,12 @@ if nmetrics > 0:
         print 'metrics '+str(imetric)+'/'+str(nmetrics)+': ', metrics_name
         if metrics_name == 'Map_plot_bias_of_multiyear_climatology':
             row, column = plot_info['subplots_array']
-            Map_plot_bias_of_multiyear_climatology(ref_dataset, ref_name, model_datasets, model_names,
-                                      file_name, row, column)
+            if 'map_projection' in plot_info.keys():
+                Map_plot_bias_of_multiyear_climatology(ref_dataset, ref_name, model_datasets, model_names,
+                                          file_name, row, column, map_projection=plot_info['map_projection'])
+            else:
+                Map_plot_bias_of_multiyear_climatology(ref_dataset, ref_name, model_datasets, model_names,
+                                          file_name, row, column)
         elif metrics_name == 'Taylor_diagram_spatial_pattern_of_multiyear_climatology':
             Taylor_diagram_spatial_pattern_of_multiyear_climatology(ref_dataset, ref_name, model_datasets, model_names,
                                       file_name)


[2/3] climate git commit: shiftgrid is not loaded in run_RCMES.py

Posted by hu...@apache.org.
shiftgrid is not loaded in run_RCMES.py


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

Branch: refs/heads/master
Commit: c01e1151c1f2b8824d5cb117f50fbd737647cbfc
Parents: a94d3b1
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Sat Oct 17 16:41:13 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Sat Oct 17 16:41:13 2015 -0700

----------------------------------------------------------------------
 examples/configuration_file_examples/run_RCMES.py | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/c01e1151/examples/configuration_file_examples/run_RCMES.py
----------------------------------------------------------------------
diff --git a/examples/configuration_file_examples/run_RCMES.py b/examples/configuration_file_examples/run_RCMES.py
index 5f15dfe..fd55be3 100644
--- a/examples/configuration_file_examples/run_RCMES.py
+++ b/examples/configuration_file_examples/run_RCMES.py
@@ -8,7 +8,6 @@ from ocw.dataset import Bounds
 
 import matplotlib.pyplot as plt
 from matplotlib import rcParams
-from mpl_toolkits.basemap import shiftgrid
 import numpy as np
 import numpy.ma as ma
 import yaml


[3/3] climate git commit: CLIMATE-696 - Examples to evaluate CORDEX-ARCTIC RCMs

Posted by hu...@apache.org.
CLIMATE-696 - Examples to evaluate CORDEX-ARCTIC RCMs

- run_RCMES.py and metrics_and_plots 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/f4e7bd61
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/f4e7bd61
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/f4e7bd61

Branch: refs/heads/master
Commit: f4e7bd61cdfa4a75b7b755a17b9b7c05a855f5f9
Parents: 360b572 c01e115
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Wed Oct 21 17:56:58 2015 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Wed Oct 21 17:56:58 2015 -0700

----------------------------------------------------------------------
 .../configuration_file_examples/metrics_and_plots.py  | 14 +++++++++++---
 examples/configuration_file_examples/run_RCMES.py     | 10 ++++++++--
 2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------