Mercurial > repos > ecology > xarray_coords_info
annotate xarray_netcdf2netcdf.py @ 2:3e73f657a998 draft
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
author | ecology |
---|---|
date | Thu, 20 Jan 2022 17:07:54 +0000 |
parents | fea8a53f8099 |
children |
rev | line source |
---|---|
2
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
1 #!/usr/bin/env python3 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
2 # |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
3 # Apply operations on selected variables |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
4 # - scale |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
5 # one can also select the range of time (for timeseries) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
6 # to apply these operations over the range only |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
7 # when a range of time is selected and when scaling, one |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
8 # can choose to save the entire timeseries or |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
9 # the selected range only. |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
10 # when scaling, one can add additional filters on dimensions |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
11 # (typically used to filter over latitudes and longitudes) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
12 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
13 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
14 import argparse |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
15 import re |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
16 import warnings |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
17 from pathlib import Path |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
18 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
19 import xarray as xr # noqa: E402 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
20 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
21 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
22 class netCDF2netCDF (): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
23 def __init__(self, infile, varname, scale="", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
24 output="output.netcdf", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
25 write_all=False, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
26 keep_attributes=True, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
27 filter_list="", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
28 where_config="", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
29 other="", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
30 sel=False, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
31 drop=False, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
32 verbose=False): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
33 self.drop = drop |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
34 if Path(where_config).exists(): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
35 f = open(where_config) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
36 self.where = f.read().replace("\n", "") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
37 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
38 self.where = "" |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
39 self.other = other |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
40 self.sel = sel |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
41 li = list(infile.split(",")) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
42 if len(li) > 1: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
43 self.infile = li |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
44 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
45 self.infile = infile |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
46 self.verbose = verbose |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
47 if varname == 'None' or varname is None: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
48 self.varname = varname |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
49 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
50 li = list(varname.split(",")) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
51 self.varname = li |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
52 self.write_all = write_all |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
53 self.keep_attributes = keep_attributes |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
54 if self.keep_attributes: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
55 xr.set_options(keep_attrs=True) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
56 self.filter = filter_list |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
57 self.selection = {} |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
58 self.method = {} |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
59 if scale == "" or scale is None: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
60 self.scale = 1 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
61 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
62 self.scale = float(scale) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
63 if output is None: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
64 self.output = "output.netcdf" |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
65 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
66 self.output = output |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
67 # initialization |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
68 self.dset = None |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
69 self.subset = None |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
70 if self.verbose: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
71 print("infile: ", self.infile) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
72 print("varname: ", self.varname) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
73 print("filter_list: ", self.filter) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
74 print("scale: ", self.scale) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
75 print("write_all: ", self.write_all) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
76 print("keep_attributes: ", self.keep_attributes) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
77 print("sel: ", self.sel) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
78 print("output: ", self.output) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
79 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
80 def apply_selection(self): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
81 self.dset = self.ds |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
82 for key in self.selection: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
83 if 'slice' in str(self.selection[key]): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
84 self.dset = self.dset.sel( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
85 {key: self.selection[key]} |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
86 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
87 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
88 self.dset = self.dset.sel( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
89 {key: self.selection[key]}, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
90 method=self.method[key] |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
91 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
92 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
93 def dimension_selection(self, single_filter): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
94 split_filter = single_filter.split('#') |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
95 dimension_varname = split_filter[0] |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
96 op = split_filter[1] |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
97 if self.sel: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
98 ll = float(split_filter[2]) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
99 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
100 ll = int(split_filter[2]) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
101 if (op == 'sl'): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
102 if self.sel: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
103 rl = float(split_filter[3]) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
104 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
105 rl = int(split_filter[3]) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
106 self.selection[dimension_varname] = slice(ll, rl) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
107 elif (op == 'to'): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
108 self.selection[dimension_varname] = slice(None, ll) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
109 elif (op == 'from'): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
110 self.selection[dimension_varname] = slice(ll, None) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
111 elif (op == 'is'): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
112 self.selection[dimension_varname] = ll |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
113 if self.sel: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
114 rl = split_filter[3] |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
115 if 'None' in rl: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
116 self.method[dimension_varname] = None |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
117 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
118 self.method[dimension_varname] = rl |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
119 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
120 def filter_selection(self): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
121 for single_filter in self.filter: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
122 self.dimension_selection(single_filter) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
123 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
124 if self.sel: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
125 self.apply_selection() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
126 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
127 self.dset = \ |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
128 self.ds.isel(self.selection) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
129 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
130 if self.varname != 'None' and self.varname is not None: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
131 for var in self.varname: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
132 self.dset[var] = \ |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
133 self.dset[var]*self.scale |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
134 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
135 def compute(self): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
136 if self.dset is None: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
137 if type(self.infile) is list: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
138 self.ds = xr.open_mfdataset(self.infile) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
139 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
140 self.ds = xr.open_dataset(self.infile) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
141 if self.where != "": |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
142 if self.drop: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
143 if self.verbose: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
144 print("Where with drop=True") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
145 self.ds = self.ds.where( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
146 self.eval_where(self.where), |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
147 drop=True |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
148 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
149 elif self.other is not None and self.other != "": |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
150 if self.verbose: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
151 print("Where with other=", float(self.other)) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
152 self.ds = self.ds.where( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
153 self.eval_where(self.where), |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
154 other=float(self.other) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
155 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
156 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
157 self.ds = self.ds.where( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
158 self.eval_where(self.where) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
159 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
160 self.filter_selection() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
161 if self.verbose: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
162 print(self.selection) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
163 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
164 def save(self): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
165 if self.varname != 'None' and \ |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
166 self.varname is not None and \ |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
167 not self.write_all: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
168 self.dset[self.varname].to_netcdf(self.output) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
169 else: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
170 self.dset.to_netcdf(self.output) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
171 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
172 def is_float(self, element) -> bool: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
173 try: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
174 float(element) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
175 return True |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
176 except ValueError: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
177 return False |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
178 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
179 def eval_where(self, where_condition): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
180 eval_cond = None |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
181 list_names = list(set( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
182 list(self.ds.keys()) + |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
183 list(self.ds.coords.keys())) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
184 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
185 wcond = where_condition |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
186 check_cond = where_condition |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
187 for var in list_names: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
188 wcond = wcond.replace(var, ' self.ds.' + var + ' ') |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
189 check_cond = check_cond.replace(var, '') |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
190 to_remove = "[><=&|()]" |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
191 check_cond = re.sub(to_remove, "", check_cond).replace("!", "") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
192 check_cond = re.sub(' +', ' ', check_cond).strip() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
193 list_flt = check_cond.split(" ") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
194 no_convert = False |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
195 for num in list_flt: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
196 if not self.is_float(num): |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
197 no_convert = True |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
198 if not no_convert: |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
199 eval_cond = eval(wcond) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
200 return eval_cond |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
201 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
202 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
203 if __name__ == '__main__': |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
204 warnings.filterwarnings("ignore") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
205 parser = argparse.ArgumentParser() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
206 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
207 'input', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
208 help='input filename in netCDF format' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
209 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
210 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
211 'varname', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
212 help='Specify which variable to plot (case sensitive)' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
213 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
214 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
215 '--filter', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
216 nargs="*", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
217 help='Filter list variable#operator#value_s#value_e' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
218 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
219 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
220 '--where', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
221 help='filename with where condition to be evaluated' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
222 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
223 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
224 '--output', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
225 help='Output filename to store the resulting netCDF file' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
226 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
227 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
228 '--scale', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
229 help='scale factor to apply to selection (float)' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
230 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
231 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
232 '--other', |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
233 help='Value to use for locations where condition is False (float)' |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
234 ) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
235 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
236 "--write_all", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
237 help="write all data to netCDF", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
238 action="store_true") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
239 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
240 "--keep_attributes", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
241 help="Keep all attributes", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
242 action="store_true") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
243 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
244 "-v", "--verbose", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
245 help="switch on verbose mode", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
246 action="store_true") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
247 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
248 "--selection", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
249 help="select by values", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
250 action="store_true") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
251 parser.add_argument( |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
252 "--drop", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
253 help="drop values where condition is not met", |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
254 action="store_true") |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
255 args = parser.parse_args() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
256 |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
257 print("args.selection", args.selection) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
258 dset = netCDF2netCDF(infile=args.input, varname=args.varname, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
259 scale=args.scale, output=args.output, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
260 write_all=args.write_all, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
261 sel=args.selection, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
262 keep_attributes=args.keep_attributes, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
263 filter_list=args.filter, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
264 where_config=args.where, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
265 drop=args.drop, other=args.other, |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
266 verbose=args.verbose) |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
267 dset.compute() |
3e73f657a998
"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
ecology
parents:
0
diff
changeset
|
268 dset.save() |