Mercurial > repos > ecology > xarray_netcdf2netcdf
comparison xarray_netcdf2netcdf.xml @ 0:b0780241f916 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:50:11 +0000 |
parents | |
children | 1a91e551f3a9 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b0780241f916 |
---|---|
1 <tool id="xarray_netcdf2netcdf" name="NetCDF xarray operations" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | |
2 <description>manipulate xarray from netCDF and save back to netCDF</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="edam_ontology"/> | |
7 <requirements> | |
8 <requirement type="package" version="3">python</requirement> | |
9 <requirement type="package" version="1.5.6">netcdf4</requirement> | |
10 <requirement type="package" version="@TOOL_VERSION@">xarray</requirement> | |
11 </requirements> | |
12 <command detect_errors="exit_code"><![CDATA[ | |
13 mkdir output_dir && | |
14 python '$__tool_directory__/xarray_netcdf2netcdf.py' '$input' '$var' | |
15 --filter | |
16 #for $i,$uc in enumerate($user_choice) | |
17 #if $uc.condi_between.comparator=="sl" | |
18 '${uc.dim}#${uc.condi_between.comparator}#${uc.condi_between.t1}#${uc.condi_between.t2}' | |
19 #else | |
20 '${uc.dim}#${uc.condi_between.comparator}#${uc.condi_between.value}' | |
21 #end if | |
22 #end for | |
23 #if $scale | |
24 --scale '$scale' | |
25 #end if | |
26 #if $write_all | |
27 --write_all | |
28 #end if | |
29 --verbose | |
30 --output '$output_netcdf' | |
31 ]]></command> | |
32 <inputs> | |
33 <param type="data" name="input" label="Input netcdf file" format="netcdf"/> | |
34 <param type="data" label="Tabular of variables" name="var_tab" format="tabular" help="Select the tabular file which summarize the available variables and dimensions."/> | |
35 | |
36 <param name="var" type="select" label="Choose the variable to extract"> | |
37 <options from_dataset="var_tab"> | |
38 <column name="name" index="0"/> | |
39 <column name="value" index="0"/> | |
40 </options> | |
41 </param> | |
42 | |
43 <repeat name="user_choice" title="additional filter" min="0" max="20" help="Use this option to filter on the selected dataset"> | |
44 <param name="dim" type="select" label="Dimensions"> | |
45 <options from_dataset="var_tab"> | |
46 <column name="value" index="0"/> | |
47 </options> | |
48 </param> | |
49 <param type="data" label="Tabular containing values of this dimension" name="dim_tab" format="tabular" help="File containing values for this dimension."/> | |
50 <conditional name="condi_between"> | |
51 <param name="comparator" type="select" label="Comparator"> | |
52 <option value="is">is</option> | |
53 <option value="from">from</option> | |
54 <option value="to">to</option> | |
55 <option value="sl">slice(threshold1,threshold2)</option> | |
56 </param> | |
57 <when value="sl"> | |
58 <param name="t1" type="select" multiple="false" label="Choose the start value for slice"> | |
59 <options from_dataset="dim_tab"> | |
60 <column name="name" index="1"/> | |
61 <column name="value" index="0"/> | |
62 </options> | |
63 </param> | |
64 <param name="t2" type="select" multiple="false" label="Choose the end value for slice"> | |
65 <options from_dataset="dim_tab"> | |
66 <column name="name" index="1"/> | |
67 <column name="value" index="0"/> | |
68 </options> | |
69 </param> | |
70 </when> | |
71 <when value="is"> | |
72 <param name="value" type="select" multiple="false" label="Choose the value to select"> | |
73 <options from_dataset="dim_tab"> | |
74 <column name="name" index="1"/> | |
75 <column name="value" index="0"/> | |
76 </options> | |
77 </param> | |
78 </when> | |
79 <when value="to"> | |
80 <param name="value" type="select" multiple="false" label="Choose the end value"> | |
81 <options from_dataset="dim_tab"> | |
82 <column name="name" index="1"/> | |
83 <column name="value" index="0"/> | |
84 </options> | |
85 </param> | |
86 </when> | |
87 <when value="from"> | |
88 <param name="value" type="select" multiple="false" label="Choose the start value"> | |
89 <options from_dataset="dim_tab"> | |
90 <column name="name" index="1"/> | |
91 <column name="value" index="0"/> | |
92 </options> | |
93 </param> | |
94 </when> | |
95 </conditional> | |
96 </repeat> | |
97 <param type="float" name="scale" optional="true" help="scale factor (float) to apply to selection (optional)"/> | |
98 | |
99 <param name="write_all" type="boolean" value="false" label="Write all variables to new netCDF file"/> | |
100 </inputs> | |
101 <outputs> | |
102 <data name="output_netcdf" format="netcdf"/> | |
103 </outputs> | |
104 <tests> | |
105 <test> | |
106 <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> | |
107 <param name="var_tab" value="var_tab_dataset-ibi"/> | |
108 <param name="var" value="chl"/> | |
109 <repeat name="user_choice"> | |
110 <param name="dim" value="time"/> | |
111 <conditional name="condi_between"> | |
112 <param name="comparator" value="sl"/> | |
113 <param name="t1" value="10"/> | |
114 <param name="t2" value="12"/> | |
115 </conditional> | |
116 </repeat> | |
117 <repeat name="user_choice"> | |
118 <param name="dim" value="latitude"/> | |
119 <param name="dim_tab" value="latitude.tabular"/> | |
120 <conditional name="condi_between"> | |
121 <param name="comparator" value="sl"/> | |
122 <param name="t1" value="5"/> | |
123 <param name="t2" value="10"/> | |
124 </conditional> | |
125 </repeat> | |
126 <repeat name="user_choice"> | |
127 <param name="dim" value="longitude"/> | |
128 <param name="dim_tab" value="longitude.tabular"/> | |
129 <conditional name="condi_between"> | |
130 <param name="comparator" value="sl"/> | |
131 <param name="t1" value="4"/> | |
132 <param name="t2" value="10"/> | |
133 </conditional> | |
134 </repeat> | |
135 <param name="scale" value="1000.5"/> | |
136 <output name="output_netcdf" file="small.netcdf" compare="sim_size" delat="1000"/> | |
137 </test> | |
138 <test> | |
139 <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> | |
140 <param name="var_tab" value="var_tab_dataset-ibi"/> | |
141 <param name="var" value="chl"/> | |
142 <repeat name="user_choice"> | |
143 <param name="dim" value="time"/> | |
144 <conditional name="condi_between"> | |
145 <param name="comparator" value="sl"/> | |
146 <param name="t1" value="10"/> | |
147 <param name="t2" value="12"/> | |
148 </conditional> | |
149 </repeat> | |
150 <repeat name="user_choice"> | |
151 <param name="dim" value="latitude"/> | |
152 <param name="dim_tab" value="latitude.tabular"/> | |
153 <conditional name="condi_between"> | |
154 <param name="comparator" value="sl"/> | |
155 <param name="t1" value="5"/> | |
156 <param name="t2" value="10"/> | |
157 </conditional> | |
158 </repeat> | |
159 <repeat name="user_choice"> | |
160 <param name="dim" value="longitude"/> | |
161 <param name="dim_tab" value="longitude.tabular"/> | |
162 <conditional name="condi_between"> | |
163 <param name="comparator" value="sl"/> | |
164 <param name="t1" value="4"/> | |
165 <param name="t2" value="10"/> | |
166 </conditional> | |
167 </repeat> | |
168 <param name="scale" value="1000.5"/> | |
169 <param name="write_all" value="Yes"/> | |
170 <output name="output_netcdf" file="all.netcdf" compare="sim_size" delat="1000"/> | |
171 </test> | |
172 </tests> | |
173 <help><![CDATA[ | |
174 **What it does** | |
175 | |
176 Select a variable ans can restrict over any of its dimension and apply a scaling (1 by default). | |
177 the result is stored in a new netCDF file. | |
178 One can also select the range of time (for timeseries) to apply these operations over the range only | |
179 when a range of time is selected and when scaling, one can choose to save the entire timeseries or | |
180 the selected range only. | |
181 when scaling, one can add additional filters on dimensions (typically used to filter | |
182 over latitudes and longitudes) | |
183 | |
184 | |
185 ------------------------------------------------- | |
186 | |
187 The xarray select tool can be used after the xarray Info and xarray Coord. | |
188 ]]></help> | |
189 <expand macro="citations"/> | |
190 </tool> |