Skip to content

Commit 58ef309

Browse files
authored
Merge branch 'master' into cdat8
2 parents 8186a28 + 4bb1987 commit 58ef309

File tree

8 files changed

+123
-48
lines changed

8 files changed

+123
-48
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* [Quick Start Guide for AIMS4/ACME1](https://acme-climate.github.io/acme_diags/docs/html/quick-guide-aims4.html)
1818
* [Model vs Model Comparison](https://github.com/ACME-Climate/acme_diags/blob/master/examples/model-vs-model/model-vs-model.ipynb)
1919
* [Observation vs Observation Comparison](https://github.com/ACME-Climate/acme_diags/blob/master/examples/obs-vs-obs/obs-vs-obs.ipynb)
20-
* [Model vs Observation: comparing temperature at 200mb and 800mb with different variable names in the model and obs](https://github.com/ACME-Climate/acme_diags/blob/master/examples/model-vs-obs/model-vs-obs.ipynb)
20+
* [Model vs Observation](https://github.com/ACME-Climate/acme_diags/blob/master/examples/model-vs-obs/model-vs-obs.ipynb)
2121

2222
## Overview<a name="overview"></a>
2323
This diagnostics package is constructed for supporting the diagnostics task of DOE's [Energy Exascale Earth System Model (E3SM) project](https://climatemodeling.science.energy.gov/projects/accelerated-climate-modeling-energy). The goal of this work is to develop a comprehensive diagnostics package that:

acme_diags/acme_parser.py

Lines changed: 111 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def load_default_args(self, files=[]):
1616
type=str,
1717
dest='reference_data_set',
1818
help='List of observations or models that are used as a ' +
19-
'reference against the test_data_set',
19+
'reference against the test_data_set.',
2020
required=False)
2121

2222
self.add_argument(
2323
'--reference_data_path',
2424
dest='reference_data_path',
25-
help='Path for the reference climitologies',
25+
help='Path for the reference climatologies.',
2626
required=False)
2727

2828
self.add_argument(
@@ -43,13 +43,13 @@ def load_default_args(self, files=[]):
4343
type=str,
4444
dest='test_data_set',
4545
help='List of observations or models to test ' +
46-
'against the reference_data_set',
46+
'against the reference_data_set.',
4747
required=False)
4848

4949
self.add_argument(
5050
'--test_data_path',
5151
dest='test_data_path',
52-
help='Path for the test climitologies',
52+
help='Path for the test climatologies.',
5353
required=False)
5454

5555
self.add_argument(
@@ -61,115 +61,178 @@ def load_default_args(self, files=[]):
6161
self.add_argument(
6262
'--results_dir',
6363
dest='results_dir',
64-
help='Path of where to save the results',
64+
help='Path of where to save the results.',
6565
required=False)
6666

6767
self.add_argument(
6868
'--sets',
6969
nargs='+',
7070
dest='sets',
71-
help='Sets to use',
71+
help='Sets to use.',
7272
required=False)
7373

7474
self.add_argument(
7575
'-D', '--dataset',
7676
dest='dataset',
77-
help="Dataset to use. Ex: 'ACME' or 'AMWG'",
77+
help="Dataset to use. Ex: 'ACME' or 'AMWG'.",
7878
required=False)
7979

8080
self.add_argument(
8181
'--run_type',
8282
dest='run_type',
8383
help="What comparison to do. One of three options: "
84-
+ "'model_vs_obs'/'obs_vs_model', 'model_vs_model', or 'obs_vs_obs'",
84+
+ "'model_vs_obs'/'obs_vs_model', 'model_vs_model', or 'obs_vs_obs'.",
8585
required=False)
8686

8787
self.add_argument(
8888
'-v', '--variables',
8989
nargs='+',
9090
dest='variables',
91-
help='Variables to use',
91+
help='Variables to use.',
9292
required=False)
9393

9494
self.add_argument(
9595
'--plevs',
9696
type=float,
9797
nargs='+',
9898
dest='plevs',
99-
help='Selected pressure level',
99+
help='Selected pressure level.',
100100
required=False)
101101

102102
self.add_argument(
103103
'-s', '--seasons',
104104
nargs='+',
105105
dest='seasons',
106-
help='Seasons to use',
106+
help='Seasons to use.',
107107
required=False)
108108

109109
self.add_argument(
110110
'-r', '--regions',
111111
nargs='+',
112112
dest='regions',
113-
help='regions to use',
113+
help='regions to use.',
114+
required=False)
115+
116+
self.add_argument(
117+
'--regrid_tool',
118+
dest='regrid_tool',
119+
help="What regrid tool to use.",
120+
required=False)
121+
122+
self.add_argument(
123+
'--regrid_method',
124+
dest='regrid_method',
125+
help="What regrid method for the regrid tool to use.",
114126
required=False)
115127

116128
self.add_argument(
117129
'--case_id',
118130
dest='case_id',
119131
help='Defines a subdirectory to the metrics output, so multiple' +
120-
'cases can be compared',
132+
'cases can be compared.',
133+
required=False)
134+
135+
self.add_argument(
136+
'--output_format',
137+
nargs='+',
138+
dest='output_format',
139+
help="What output format the plots should be saved in. "
140+
+ "Possible values are: ['png', 'pdf', 'svg'].",
141+
required=False)
142+
143+
self.add_argument(
144+
'--canvas_size_w',
145+
type=int,
146+
dest='canvas_size_w',
147+
help="Size in pixels of the width for the output figure. "
148+
+ "VCS only.",
149+
required=False)
150+
151+
self.add_argument(
152+
'--canvas_size_h',
153+
type=int,
154+
dest='canvas_size_h',
155+
help="Size in pixels of the height for the output figure. "
156+
+ "VCS only.",
157+
required=False)
158+
159+
self.add_argument(
160+
'--figsize',
161+
type=float,
162+
nargs='+',
163+
dest='figsize',
164+
help="Width and height like so: [width, height]. "
165+
+ "Matplotlib only.",
166+
required=False)
167+
168+
self.add_argument(
169+
'--dpi',
170+
type=int,
171+
dest='dpi',
172+
help="DPI to use. "
173+
+ "Matplotlib only.",
174+
required=False)
175+
176+
self.add_argument(
177+
'--arrows',
178+
dest='arrows',
179+
help='Display arrows on the plot.',
180+
action='store_const',
181+
const=True,
121182
required=False)
122183

123184
self.add_argument(
124-
'-o', '--output_file',
125-
dest='output_file',
126-
help='Name of the output file',
185+
'--logo',
186+
dest='logo',
187+
help='Display the logo. VCS only.',
188+
action='store_const',
189+
const=True,
127190
required=False)
128191

129192
self.add_argument(
130193
'--contour_levels',
131194
type=float,
132195
nargs='+',
133196
dest='contour_levels',
134-
help='Levels for the test and reference',
197+
help='Levels for the test and reference plots.',
135198
required=False)
136199

137200
self.add_argument(
138201
'--diff_levels',
139202
type=float,
140203
nargs='+',
141204
dest='diff_levels',
142-
help='Levels for the difference',
205+
help='Levels for the difference plot.',
143206
required=False)
144207

145208
self.add_argument(
146209
'--reference_name',
147210
dest='reference_name',
148-
help='Name of the reference variable',
211+
help='Name of the reference variable.',
149212
required=False)
150213

151214
self.add_argument(
152215
'--test_name',
153216
dest='test_name',
154-
help='Name of the test variable',
217+
help='Name of the test variable.',
155218
required=False)
156219

157220
self.add_argument(
158221
'--short_test_name',
159222
dest='short_test_name',
160-
help='User-defined test name',
223+
help='User-defined test name.',
161224
required=False)
162225

163226
self.add_argument(
164227
'--diff_name',
165228
dest='diff_name',
166-
help='Name of the difference variable',
229+
help='Name of the difference variable.',
167230
required=False)
168231

169232
self.add_argument(
170233
'--main_title',
171234
dest='main_title',
172-
help='The big title that appears on the top of the graph',
235+
help='The big title that appears on the top of the graph.',
173236
required=False)
174237

175238
self.add_argument(
@@ -181,13 +244,13 @@ def load_default_args(self, files=[]):
181244
self.add_argument(
182245
'--test_title',
183246
dest='test_title',
184-
help='Title for the top graph',
247+
help='Title for the top graph.',
185248
required=False)
186249

187250
self.add_argument(
188251
'--diff_title',
189252
dest='diff_title',
190-
help='Title for the bottom graph',
253+
help='Title for the bottom graph.',
191254
required=False)
192255

193256
self.add_argument(
@@ -199,33 +262,51 @@ def load_default_args(self, files=[]):
199262
self.add_argument(
200263
'--test_colormap',
201264
dest='test_colormap',
202-
help='Colormap for the top graph',
265+
help='Colormap for the top graph.',
203266
required=False)
204267

205268
self.add_argument(
206269
'--diff_colormap',
207270
dest='diff_colormap',
208-
help='Colormap for the bottom graph',
271+
help='Colormap for the bottom graph.',
272+
required=False)
273+
274+
self.add_argument(
275+
'--reference_units',
276+
dest='reference_units',
277+
help='Units to use for the middle graph.',
278+
required=False)
279+
280+
self.add_argument(
281+
'--test_units',
282+
dest='test_units',
283+
help='Units to use for the top graph.',
284+
required=False)
285+
286+
self.add_argument(
287+
'--diff_units',
288+
dest='diff_units',
289+
help='Units to use for the bottom graph.',
209290
required=False)
210291

211292
self.add_argument(
212293
'--backend',
213294
dest='backend',
214-
help='Graphical backend to use',
295+
help='Graphical backend to use.',
215296
required=False)
216297

217298
self.add_argument(
218299
'--multiprocessing',
219300
dest='multiprocessing',
220-
help='Run the diags using multiprocessing',
301+
help='Run the diags using multiprocessing.',
221302
action='store_const',
222303
const=True,
223304
required=False)
224305

225306
self.add_argument(
226307
'--distributed',
227308
dest='distributed',
228-
help='Run the diags distributedly',
309+
help='Run the diags distributedly.',
229310
action='store_const',
230311
const=True,
231312
required=False)

acme_diags/acme_viewer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ def create_metadata(parameter):
495495
args = parser.view_args()
496496
supported_cmd_args = args.__dict__.keys()
497497

498+
if 'other_parameters' in supported_cmd_args:
499+
supported_cmd_args.remove('other_parameters')
500+
498501
for param_name in parameter.__dict__:
499502
param = parameter.__dict__[param_name]
500503
# we don't want to include blank values

acme_diags/driver/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def select_region(region, var1, var2, land_frac, ocean_frac, parameter):
132132
var1_domain = mask_by(
133133
var1, land_ocean_frac, low_limit=region_value)
134134
var2_domain = var2.regrid(
135-
var1.getGrid(), parameter.regrid_tool, parameter.regrid_method)
135+
var1.getGrid(), regridTool=parameter.regrid_tool, regridMethod=parameter.regrid_method)
136136
var2_domain = mask_by(
137137
var2_domain, land_ocean_frac, low_limit=region_value)
138138
else:

examples/model-vs-model/model-vs-model.ipynb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@
9393
"variables = [\"SST\"]\n",
9494
"seasons = [\"ANN\", \"DJF\", \"MAM\", \"JJA\", \"SON\"]\n",
9595
"contour_levels = [-1, 0, 1, 3, 6, 9, 12, 15, 18, 20, 22, 24, 26, 28, 29]\n",
96-
"diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.2, 0.2, 0.5, 1, 2, 3, 4, 5]\n",
97-
"\n",
98-
"\n",
99-
"\n",
100-
"\n"
96+
"diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.2, 0.2, 0.5, 1, 2, 3, 4, 5]\n"
10197
]
10298
},
10399
{
@@ -165,7 +161,7 @@
165161
"metadata": {
166162
"anaconda-cloud": {},
167163
"kernelspec": {
168-
"display_name": "Python [default]",
164+
"display_name": "Python 2",
169165
"language": "python",
170166
"name": "python2"
171167
},
@@ -179,7 +175,7 @@
179175
"name": "python",
180176
"nbconvert_exporter": "python",
181177
"pygments_lexer": "ipython2",
182-
"version": "2.7.12"
178+
"version": "2.7.14"
183179
}
184180
},
185181
"nbformat": 4,

examples/model-vs-model/mydiags.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ diff_colormap = "BrBG"
1010
contour_levels = [0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16]
1111
diff_levels = [-5, -4, -3, -2, -1, -0.5, 0.5, 1, 2, 3, 4, 5]
1212

13-
1413
[#]
1514
sets = ["lat_lon"]
1615
case_id = "model_vs_model"
@@ -19,6 +18,3 @@ seasons = ["ANN", "DJF", "MAM", "JJA", "SON"]
1918
contour_levels = [-1, 0, 1, 3, 6, 9, 12, 15, 18, 20, 22, 24, 26, 28, 29]
2019
diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.2, 0.2, 0.5, 1, 2, 3, 4, 5]
2120

22-
23-
24-

0 commit comments

Comments
 (0)