climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [1/4] climate git commit: CLIMATE-602 - Add support for multiple contour map result indices
Date Wed, 18 Mar 2015 16:46:37 GMT
Repository: climate
Updated Branches:
  refs/heads/master a0f0615eb -> db77e99ff


CLIMATE-602 - Add support for multiple contour map result indices

- Contour map plotting now properly handles a list of tuples of result
  indices when plotting. Each tuple is plotted using all the other
  configuration values by default.
- Contour map plot names now have an identifier number at the end that
  corresponds with the result index used to generate them.


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

Branch: refs/heads/master
Commit: 9f9e02d3ccb80fb68985ee6c7781ab07a8316986
Parents: a0f0615
Author: Michael Joyce <joyce@apache.org>
Authored: Mon Mar 16 13:29:21 2015 -0700
Committer: Michael Joyce <joyce@apache.org>
Committed: Mon Mar 16 13:29:21 2015 -0700

----------------------------------------------------------------------
 ocw-config-runner/plot_generation.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/9f9e02d3/ocw-config-runner/plot_generation.py
----------------------------------------------------------------------
diff --git a/ocw-config-runner/plot_generation.py b/ocw-config-runner/plot_generation.py
index 40c5718..5d24f49 100644
--- a/ocw-config-runner/plot_generation.py
+++ b/ocw-config-runner/plot_generation.py
@@ -54,8 +54,6 @@ def plot_from_config(evaluation, config_data):
 
 def _draw_contour_plot(evaluation, plot_config):
     """"""
-    row, col = plot_config['results_indeces'][0]
-
     lats = plot_config['lats']
     if type(lats) != type(list):
         lats = range(lats['range_min'], lats['range_max'], lats['range_step'])
@@ -64,8 +62,11 @@ def _draw_contour_plot(evaluation, plot_config):
     if type(lons) != type(list):
         lons = range(lons['range_min'], lons['range_max'], lons['range_step'])
 
-    plots.draw_contour_map(evaluation.results[row][col],
-                            np.array(lats),
-                            np.array(lons),
-                            plot_config['output_name'],
-                            **plot_config.get('optional_args', {}))
+
+    for i, (row, col) in enumerate(plot_config['results_indeces']):
+        plot_name = plot_config['output_name'] + '_{}'.format(i)
+        plots.draw_contour_map(evaluation.results[row][col],
+                                np.array(lats),
+                                np.array(lons),
+                                    plot_name,
+                                    **plot_config.get('optional_args', {}))


Mime
View raw message