annotate psymap_simple.py @ 0:db8d76da4174 draft

planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
author climate
date Thu, 25 Apr 2019 18:11:49 -0400
parents
children 706666d912d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
1 #!/usr/bin/env python3
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
2 #
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
3 #
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
4 # usage: psymap_simple.py [-h] [--proj PROJ]
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
5 # [--cmap CMAP]
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
6 # [--output OUTPUT]
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
7 # [-v]
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
8 # input varname
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
9 #
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
10 # positional arguments:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
11 # input input filename with geographical coordinates (netCDF
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
12 # format)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
13 # varname Specify which variable to plot (case sensitive)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
14 #
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
15 # optional arguments:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
16 # -h, --help show this help message and exit
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
17 # --proj PROJ Specify the projection on which we draw
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
18 # --cmap CMAP Specify which colormap to use for plotting
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
19 # --output OUTPUT output filename to store resulting image (png format)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
20 # -v, --verbose switch on verbose mode
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
21 #
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
22
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
23 import argparse
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
24 import warnings
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
25 from pathlib import Path
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
26
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
27 import matplotlib as mpl
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
28 mpl.use('Agg')
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
29 from matplotlib import pyplot # noqa: I202,E402
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
30
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
31 import psyplot.project as psy # noqa: I202,E402
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
32
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
33
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
34 class PsyPlot ():
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
35 def __init__(self, input, proj, varname, cmap, output,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
36 verbose=False
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
37 ):
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
38 self.input = input
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
39 self.proj = proj
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
40 self.varname = varname
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
41 self.cmap = cmap
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
42 if output is None:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
43 self.output = Path(input).stem + '.png'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
44 else:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
45 self.output = output
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
46 self.verbose = verbose
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
47 if verbose:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
48 print("input: ", self.input)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
49 print("proj: ", self.proj)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
50 print("varname: ", self.varname)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
51 print("cmap: ", self.cmap)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
52 print("output: ", self.output)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
53
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
54 def plot(self):
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
55 if self.cmap is None and self.proj is None:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
56 print("op1")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
57 psy.plot.mapplot(self.input, name=self.varname,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
58 clabel='{desc}')
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
59 elif self.proj is None or self.proj == '':
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
60 print("op2")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
61 psy.plot.mapplot(self.input, name=self.varname,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
62 cmap=self.cmap, clabel='{desc}')
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
63 elif self.cmap is None or self.cmap == '':
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
64 print("op3")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
65 psy.plot.mapplot(self.input, name=self.varname,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
66 projection=self.proj,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
67 clabel='{desc}')
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
68 else:
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
69 print("op4")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
70 psy.plot.mapplot(self.input, name=self.varname,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
71 cmap=self.cmap,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
72 projection=self.proj,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
73 clabel='{desc}')
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
74
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
75 pyplot.savefig(self.output)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
76
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
77
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
78 def psymap_plot(input, proj, varname, cmap, output, verbose):
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
79 """Generate plot from input filename"""
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
80
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
81 p = PsyPlot(input, proj, varname, cmap, output, verbose)
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
82 p.plot()
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
83
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
84
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
85 if __name__ == '__main__':
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
86 warnings.filterwarnings("ignore")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
87 parser = argparse.ArgumentParser()
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
88 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
89 'input',
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
90 help='input filename with geographical coordinates (netCDF format)'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
91 )
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
92
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
93 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
94 '--proj',
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
95 help='Specify the projection on which we draw'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
96 )
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
97 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
98 'varname',
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
99 help='Specify which variable to plot (case sensitive)'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
100 )
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
101 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
102 '--cmap',
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
103 help='Specify which colormap to use for plotting'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
104 )
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
105 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
106 '--output',
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
107 help='output filename to store resulting image (png format)'
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
108 )
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
109 parser.add_argument(
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
110 "-v", "--verbose",
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
111 help="switch on verbose mode",
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
112 action="store_true")
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
113 args = parser.parse_args()
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
114
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
115 psymap_plot(args.input, args.proj, args.varname, args.cmap,
db8d76da4174 planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/psy-maps commit c1362af034361b6fb869411f1ea928388f230d72
climate
parents:
diff changeset
116 args.output, args.verbose)