annotate xarray_mapplot.py @ 2:123a9a629bef draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
author ecology
date Sun, 06 Jun 2021 08:51:41 +0000
parents
children bf595d613af4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
1 #!/usr/bin/env python3
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
2 #
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
3 #
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
4 # usage: xarray_mapplot.py [-h] [--proj PROJ]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
5 # [--cmap CMAP]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
6 # [--output OUTPUT]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
7 # [--time TIMES]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
8 # [--nrow NROW]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
9 # [--ncol NCOL]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
10 # [--title title]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
11 # [--latitude LATITUDE]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
12 # [--longitude LONGITUDE]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
13 # [--land ALPHA-LAND]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
14 # [--ocean ALPHA-OCEAN]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
15 # [--coastline ALPHA-COASTLINE]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
16 # [--borders ALPHA-BORDERS]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
17 # [--xlim "x1,x2"]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
18 # [--ylim "y1,y2"]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
19 # [--range "valmin,valmax"]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
20 # [--threshold VAL]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
21 # [--label label-colorbar]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
22 # [--shift]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
23 # [-v]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
24 # input varname
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
25 #
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
26 # positional arguments:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
27 # input input filename with geographical coordinates (netCDF
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
28 # format)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
29 # varname Specify which variable to plot (case sensitive)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
30 #
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
31 # optional arguments:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
32 # -h, --help show this help message and exit
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
33 # --proj PROJ Specify the projection on which we draw
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
34 # --cmap CMAP Specify which colormap to use for plotting
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
35 # --output OUTPUT output filename to store resulting image (png format)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
36 # --time TIMES time index from the file for multiple plots ("0 1 2 3")
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
37 # --title plot or subplot title
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
38 # --latitude variable name for latitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
39 # --longitude variable name for longitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
40 # --land add land on plot with alpha value [0-1]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
41 # --ocean add oceans on plot with alpha value [0-1]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
42 # --coastline add coastline with alpha value [0-1]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
43 # --borders add country borders with alpha value [0-1]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
44 # --xlim limited geographical area longitudes "x1,x2"
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
45 # --ylim limited geographical area latitudes "y1,y2"
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
46 # --range "valmin,valmax" for plotting
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
47 # --threshold do not plot values below threshold
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
48 # --label set a label for colormap
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
49 # --shift shift longitudes if specified
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
50 # -v, --verbose switch on verbose mode
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
51 #
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
52
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
53 import argparse
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
54 import ast
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
55 import warnings
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
56 from pathlib import Path
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
57
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
58 import cartopy.crs as ccrs
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
59 import cartopy.feature as feature
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
60
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
61 from cmcrameri import cm
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
62
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
63 import matplotlib as mpl
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
64 mpl.use('Agg')
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
65 from matplotlib import pyplot # noqa: I202,E402
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
66
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
67 import xarray as xr # noqa: E402
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
68
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
69
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
70 class MapPlotXr ():
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
71 def __init__(self, input, proj, varname, cmap, output, verbose=False,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
72 time=[], title="", latitude="latitude",
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
73 longitude="longitude", land=0, ocean=0,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
74 coastline=0, borders=0, xlim=[], ylim=[],
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
75 threshold="", label="", shift=False,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
76 range_values=[]):
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
77 self.input = input
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
78 print("PROJ", proj)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
79 if proj != "" and proj is not None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
80 self.proj = proj.replace('X', ':')
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
81 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
82 self.proj = proj
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
83 self.varname = varname
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
84 self.get_cmap(cmap)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
85 self.time = time
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
86 self.latitude = latitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
87 self.longitude = longitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
88 self.land = land
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
89 self.ocean = ocean
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
90 self.coastline = coastline
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
91 self.borders = borders
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
92 self.xlim = xlim
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
93 self.ylim = ylim
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
94 self.range = range_values
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
95 self.threshold = threshold
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
96 self.shift = shift
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
97 self.xylim_supported = False
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
98 self.colorbar = True
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
99 self.title = title
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
100 if output is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
101 self.output = Path(input).stem + '.png'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
102 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
103 self.output = output
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
104 self.verbose = verbose
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
105 self.dset = xr.open_dataset(self.input, use_cftime=True)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
106
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
107 self.label = {}
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
108 if label != "" and label is not None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
109 self.label['label'] = label
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
110 if verbose:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
111 print("input: ", self.input)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
112 print("proj: ", self.proj)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
113 print("varname: ", self.varname)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
114 print("time: ", self.time)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
115 print("minval, maxval: ", self.range)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
116 print("title: ", self.title)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
117 print("output: ", self.output)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
118 print("label: ", self.label)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
119 print("shift: ", self.shift)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
120 print("ocean: ", self.ocean)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
121 print("land: ", self.land)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
122 print("coastline: ", self.coastline)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
123 print("borders: ", self.borders)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
124 print("latitude: ", self.latitude)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
125 print("longitude: ", self.longitude)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
126 print("xlim: ", self.xlim)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
127 print("ylim: ", self.ylim)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
128
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
129 def get_cmap(self, cmap):
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
130 if cmap[0:3] == 'cm.':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
131 self.cmap = cm.__dict__[cmap[3:]]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
132 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
133 self.cmap = cmap
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
134
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
135 def projection(self):
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
136 if self.proj is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
137 return ccrs.PlateCarree()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
138
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
139 proj_dict = ast.literal_eval(self.proj)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
140
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
141 user_proj = proj_dict.pop("proj")
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
142 if user_proj == 'PlateCarree':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
143 self.xylim_supported = True
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
144 return ccrs.PlateCarree(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
145 elif user_proj == 'AlbersEqualArea':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
146 return ccrs.AlbersEqualArea(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
147 elif user_proj == 'AzimuthalEquidistant':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
148 return ccrs.AzimuthalEquidistant(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
149 elif user_proj == 'EquidistantConic':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
150 return ccrs.EquidistantConic(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
151 elif user_proj == 'LambertConformal':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
152 return ccrs.LambertConformal(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
153 elif user_proj == 'LambertCylindrical':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
154 return ccrs.LambertCylindrical(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
155 elif user_proj == 'Mercator':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
156 return ccrs.Mercator(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
157 elif user_proj == 'Miller':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
158 return ccrs.Miller(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
159 elif user_proj == 'Mollweide':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
160 return ccrs.Mollweide(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
161 elif user_proj == 'Orthographic':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
162 return ccrs.Orthographic(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
163 elif user_proj == 'Robinson':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
164 return ccrs.Robinson(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
165 elif user_proj == 'Sinusoidal':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
166 return ccrs.Sinusoidal(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
167 elif user_proj == 'Stereographic':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
168 return ccrs.Stereographic(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
169 elif user_proj == 'TransverseMercator':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
170 return ccrs.TransverseMercator(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
171 elif user_proj == 'UTM':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
172 return ccrs.UTM(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
173 elif user_proj == 'InterruptedGoodeHomolosine':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
174 return ccrs.InterruptedGoodeHomolosine(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
175 elif user_proj == 'RotatedPole':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
176 return ccrs.RotatedPole(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
177 elif user_proj == 'OSGB':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
178 self.xylim_supported = False
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
179 return ccrs.OSGB(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
180 elif user_proj == 'EuroPP':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
181 self.xylim_supported = False
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
182 return ccrs.EuroPP(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
183 elif user_proj == 'Geostationary':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
184 return ccrs.Geostationary(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
185 elif user_proj == 'NearsidePerspective':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
186 return ccrs.NearsidePerspective(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
187 elif user_proj == 'EckertI':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
188 return ccrs.EckertI(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
189 elif user_proj == 'EckertII':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
190 return ccrs.EckertII(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
191 elif user_proj == 'EckertIII':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
192 return ccrs.EckertIII(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
193 elif user_proj == 'EckertIV':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
194 return ccrs.EckertIV(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
195 elif user_proj == 'EckertV':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
196 return ccrs.EckertV(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
197 elif user_proj == 'EckertVI':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
198 return ccrs.EckertVI(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
199 elif user_proj == 'EqualEarth':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
200 return ccrs.EqualEarth(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
201 elif user_proj == 'Gnomonic':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
202 return ccrs.Gnomonic(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
203 elif user_proj == 'LambertAzimuthalEqualArea':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
204 return ccrs.LambertAzimuthalEqualArea(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
205 elif user_proj == 'NorthPolarStereo':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
206 return ccrs.NorthPolarStereo(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
207 elif user_proj == 'OSNI':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
208 return ccrs.OSNI(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
209 elif user_proj == 'SouthPolarStereo':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
210 return ccrs.SouthPolarStereo(**proj_dict)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
211
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
212 def plot(self, ts=None):
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
213 if self.shift:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
214 if self.longitude == 'longitude':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
215 self.dset = self.dset.assign_coords(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
216 longitude=(((
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
217 self.dset[self.longitude]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
218 + 180) % 360) - 180))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
219 elif self.longitude == 'lon':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
220 self.dset = self.dset.assign_coords(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
221 lon=(((self.dset[self.longitude]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
222 + 180) % 360) - 180))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
223
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
224 pyplot.figure(1, figsize=[20, 10])
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
225
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
226 # Set the projection to use for plotting
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
227 ax = pyplot.subplot(1, 1, 1, projection=self.projection())
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
228 if self.land:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
229 ax.add_feature(feature.LAND, alpha=self.land)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
230
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
231 if self.ocean:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
232 ax.add_feature(feature.OCEAN, alpha=self.ocean)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
233 if self.coastline:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
234 ax.coastlines(resolution='10m', alpha=self.coastline)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
235 if self.borders:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
236 ax.add_feature(feature.BORDERS, linestyle=':', alpha=self.borders)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
237
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
238 if self.xlim:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
239 min_lon = min(self.xlim[0], self.xlim[1])
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
240 max_lon = max(self.xlim[0], self.xlim[1])
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
241 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
242 min_lon = self.dset[self.longitude].min()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
243 max_lon = self.dset[self.longitude].max()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
244
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
245 if self.ylim:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
246 min_lat = min(self.ylim[0], self.ylim[1])
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
247 max_lat = max(self.ylim[0], self.ylim[1])
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
248 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
249 min_lat = self.dset[self.latitude].min()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
250 max_lat = self.dset[self.latitude].max()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
251
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
252 if self.xylim_supported:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
253 pyplot.xlim(min_lon, max_lon)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
254 pyplot.ylim(min_lat, max_lat)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
255
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
256 # Fix extent
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
257 if self.threshold == "" or self.threshold is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
258 threshold = self.dset[self.varname].min()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
259 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
260 threshold = float(self.threshold)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
261
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
262 if self.range == []:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
263 minval = self.dset[self.varname].min()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
264 maxval = self.dset[self.varname].max()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
265 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
266 minval = self.range[0]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
267 maxval = self.range[1]
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
268
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
269 if self.verbose:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
270 print("minval: ", minval)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
271 print("maxval: ", maxval)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
272
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
273 # pass extent with vmin and vmax parameters
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
274 proj_t = ccrs.PlateCarree()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
275 if ts is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
276 self.dset.where(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
277 self.dset[self.varname] > threshold
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
278 )[self.varname].plot(ax=ax,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
279 vmin=minval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
280 vmax=maxval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
281 transform=proj_t,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
282 cmap=self.cmap,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
283 cbar_kwargs=self.label
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
284 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
285 if self.title != "" and self.title is not None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
286 pyplot.title(self.title)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
287 pyplot.savefig(self.output)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
288 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
289 if self.colorbar:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
290 self.dset.where(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
291 self.dset[self.varname] > threshold
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
292 )[self.varname].isel(time=ts).plot(ax=ax,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
293 vmin=minval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
294 vmax=maxval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
295 transform=proj_t,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
296 cmap=self.cmap,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
297 cbar_kwargs=self.label
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
298 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
299 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
300 self.dset.where(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
301 self.dset[self.varname] > minval
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
302 )[self.varname].isel(time=ts).plot(ax=ax,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
303 vmin=minval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
304 vmax=maxval,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
305 transform=proj_t,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
306 cmap=self.cmap,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
307 add_colorbar=False)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
308 if self.title != "" and self.title is not None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
309 pyplot.title(self.title + "(time = " + str(ts) + ')')
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
310 pyplot.savefig(self.output[:-4] + "_time" + str(ts) +
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
311 self.output[-4:]) # assume png format
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
312
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
313
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
314 if __name__ == '__main__':
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
315 warnings.filterwarnings("ignore")
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
316 parser = argparse.ArgumentParser()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
317 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
318 'input',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
319 help='input filename with geographical coordinates (netCDF format)'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
320 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
321
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
322 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
323 '--proj',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
324 help='Specify the projection on which we draw'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
325 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
326 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
327 'varname',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
328 help='Specify which variable to plot (case sensitive)'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
329 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
330 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
331 '--cmap',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
332 help='Specify which colormap to use for plotting'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
333 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
334 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
335 '--output',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
336 help='output filename to store resulting image (png format)'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
337 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
338 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
339 '--time',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
340 help='list of times to plot for multiple plots'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
341 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
342 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
343 '--title',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
344 help='plot title'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
345 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
346 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
347 '--latitude',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
348 help='variable name for latitude'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
349 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
350 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
351 '--longitude',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
352 help='variable name for longitude'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
353 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
354 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
355 '--land',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
356 help='add land on plot with alpha value [0-1]'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
357 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
358 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
359 '--ocean',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
360 help='add oceans on plot with alpha value [0-1]'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
361 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
362 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
363 '--coastline',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
364 help='add coastline with alpha value [0-1]'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
365 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
366 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
367 '--borders',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
368 help='add country borders with alpha value [0-1]'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
369 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
370 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
371 '--xlim',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
372 help='limited geographical area longitudes "x1,x2"'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
373 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
374 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
375 '--ylim',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
376 help='limited geographical area latitudes "y1,y2"'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
377 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
378 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
379 '--range',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
380 help='min and max values for plotting "minval,maxval"'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
381 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
382 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
383 '--threshold',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
384 help='do not plot values below threshold'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
385 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
386 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
387 '--label',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
388 help='set a label for colorbar'
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
389 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
390 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
391 '--shift',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
392 help='shift longitudes if specified',
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
393 action="store_true"
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
394 )
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
395 parser.add_argument(
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
396 "-v", "--verbose",
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
397 help="switch on verbose mode",
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
398 action="store_true")
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
399 args = parser.parse_args()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
400
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
401 if args.time is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
402 time = []
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
403 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
404 time = list(map(int, args.time.split(",")))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
405 if args.xlim is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
406 xlim = []
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
407 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
408 xlim = list(map(float, args.xlim.split(",")))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
409 if args.ylim is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
410 ylim = []
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
411 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
412 ylim = list(map(float, args.ylim.split(",")))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
413 if args.range is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
414 range_values = []
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
415 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
416 range_values = list(map(float, args.range.split(",")))
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
417 if args.latitude is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
418 latitude = "latitude"
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
419 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
420 latitude = args.latitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
421 if args.longitude is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
422 longitude = "longitude"
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
423 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
424 longitude = args.longitude
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
425 if args.land is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
426 land = 0
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
427 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
428 land = float(args.land)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
429 if args.ocean is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
430 ocean = 0
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
431 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
432 ocean = float(args.ocean)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
433 if args.coastline is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
434 coastline = 0
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
435 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
436 coastline = float(args.coastline)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
437 if args.borders is None:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
438 borders = 0
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
439 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
440 borders = float(args.borders)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
441
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
442 dset = MapPlotXr(input=args.input, proj=args.proj, varname=args.varname,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
443 cmap=args.cmap, output=args.output, verbose=args.verbose,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
444 time=time, title=args.title,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
445 latitude=latitude, longitude=longitude, land=land,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
446 ocean=ocean, coastline=coastline, borders=borders,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
447 xlim=xlim, ylim=ylim, threshold=args.threshold,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
448 label=args.label, shift=args.shift,
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
449 range_values=range_values)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
450
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
451 if dset.time == []:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
452 dset.plot()
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
453 else:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
454 for t in dset.time:
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
455 dset.plot(t)
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
456 dset.shift = False # only shift once
123a9a629bef "planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
ecology
parents:
diff changeset
457 dset.colorbar = True