Mercurial > repos > climate > eodie
comparison eodie.xml @ 0:81b0ca76435d draft default tip
"planemo upload for repository https://gitlab.com/eetun-tiimi/EODIE commit c4a5672398bc878dd2bc0bf4f3a26f59b3f6395c"
author | climate |
---|---|
date | Thu, 30 Dec 2021 15:24:09 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:81b0ca76435d |
---|---|
1 <tool id="eodie" name="EODIE" version="@VERSION@" profile="20.09"> | |
2 <description>converts simple features data between file formats</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="edam_ontology"/> | |
7 <requirements> | |
8 <requirement type="package" version="@VERSION@">eodie</requirement> | |
9 <requirement type="package" version="3.9">python</requirement> | |
10 <requirement type="package" version="1.8">shapely</requirement> | |
11 <requirement type="package" version="1.2">rasterio</requirement> | |
12 <requirement type="package" version="0.16">rasterstats</requirement> | |
13 <requirement type="package" version="1.8">fiona</requirement> | |
14 <requirement type="package" version="1.21">numpy</requirement> | |
15 <requirement type="package" version="3.4.0">gdal</requirement> | |
16 <requirement type="package" version="6.0">pyyaml</requirement> | |
17 <requirement type="package" version="6.0">unzip</requirement> | |
18 <requirement type="package" version="1.34">tar</requirement> | |
19 </requirements> | |
20 <command detect_errors="exit_code"><![CDATA[ | |
21 mkdir -p work/data_collection work/results results_csv results_tiffs && | |
22 cp '$config_tif' config_tif.yml && | |
23 cp '$config_s2' config_s2.yml && | |
24 cp '$config_ls8' config_ls8.yml && | |
25 cp '$user_config' user_config.yml && | |
26 cp '${input.extra_files_path}'/* work/ && | |
27 cd work && | |
28 ln -s '${input_type.input_file}' '${input_type.input_file.element_identifier}' && | |
29 #if $input_type.input_file.is_of_type("zip") | |
30 unzip '$input_type.input_file' -d data_collection/ && | |
31 #elif $input_type.input_file.is_of_type("tar") | |
32 tar -xf '$input_type.input_file' -C data_collection && | |
33 #end if | |
34 #if str($input_type.platform) == 's2' | |
35 mkdir -p sentinel2_tiles_world && | |
36 (cp '$input_type.s2_shp.extra_files_path'/shapefile.shp sentinel2_tiles_world/sentinel2_tiles_world.shp || true ) && | |
37 (cp '$input_type.s2_shp.extra_files_path'/shapefile.shx sentinel2_tiles_world/sentinel2_tiles_world.shx || true ) && | |
38 (cp '$input_type.s2_shp.extra_files_path'/shapefile.dbf sentinel2_tiles_world/sentinel2_tiles_world.dbf || true ) && | |
39 (cp '$input_type.s2_shp.extra_files_path'/shapefile.prj sentinel2_tiles_world/sentinel2_tiles_world.prj || true ) && | |
40 #elif str($input_type.platform) == 'ls8' | |
41 mkdir -p WRS2_descending && | |
42 (cp '$input_type.ls8_shp.extra_files_path'/shapefile.shp WRS2_descending/WRS2_descending.shp || true ) && | |
43 (cp '$input_type.ls8_shp.extra_files_path'/shapefile.shx WRS2_descending/WRS2_descending.shx || true ) && | |
44 (cp '$input_type.ls8_shp.extra_files_path'/shapefile.dbf WRS2_descending/WRS2_descending.dbf || true ) && | |
45 (cp '$input_type.ls8_shp.extra_files_path'/shapefile.prj WRS2_descending/WRS2_descending.prj || true ) && | |
46 #end if | |
47 | |
48 eodie_process.py | |
49 --platform $input_type.platform | |
50 #if str($input_type.platform) == 'tif' | |
51 --file ${input_type.input_file.element_identifier} | |
52 #else | |
53 --dir data_collection | |
54 --out ./results | |
55 #end if | |
56 --shp shapefile | |
57 #for $i, $s in enumerate( $adv_options.statistics ) | |
58 #if str($i) == '0' | |
59 --statistics_out | |
60 --statistics | |
61 #end if | |
62 #if $s.stats_input.stats and str($s.stats_input.stats) != '': | |
63 #if str($s.stats_input.stats) == 'percentile': | |
64 '$s.stats_input.stats'_'$s.stats_input.p_value' | |
65 #else | |
66 '$s.stats_input.stats' | |
67 #end if | |
68 #end if | |
69 #end for | |
70 #if $adv_options.indices and str($adv_options.indices) != '': | |
71 --index | |
72 #for $idx in str($adv_options.indices).split(','): | |
73 '$idx' | |
74 #end for | |
75 #end if | |
76 #if $adv_options.start_date and str($adv_options.start_date) != '': | |
77 --start int($adv_options.start_date) | |
78 #end if | |
79 #if $adv_options.end_date and str($adv_options.end_date) != '': | |
80 --start int($adv_options.end_date) | |
81 #end if | |
82 $adv_options.exclude_border | |
83 $adv_options.exclude_splitshp | |
84 --id '$identifier' && | |
85 | |
86 mv results/*.log '$logfile' && | |
87 bash '$__tool_directory__/postprocess_csv.sh' 'results' '../results_csv' && | |
88 ( mv results/*.tif ../results_tiffs/ || echo "No tiff files generated" ) && | |
89 echo "EODIE data extractor is done" | |
90 ]]> </command> | |
91 <expand macro="configfiles"/> | |
92 <inputs> | |
93 <conditional name="input_type"> | |
94 <param name="platform" type="select" label="Select platform of the input data"> | |
95 <option value="s2">Sentinel 2</option> | |
96 <option value="ls8">Landsat 8</option> | |
97 <option value="tif">tiff file</option> | |
98 </param> | |
99 <when value="tif"> | |
100 <param name='input_file' format="tiff" type="data" label="Individual input file"/> | |
101 </when> | |
102 <when value="ls8"> | |
103 <param name="input_file" type="data" format='zip,tar' label="Landsat 8 input data (zip or tarball)" /> | |
104 <param name="ls8_shp" type="data" format="shp" label="Landsat 8 tile shapefile" help="Provide the Landsat-8 tile shapefile"/> | |
105 </when> | |
106 <when value="s2"> | |
107 <param name="input_file" type="data" format='zip,tar' label="Sentinel 2 input data (zip or tarball)" /> | |
108 <param name="s2_shp" type="data" format="shp" label="Sentinel-2 tile shapefile" help="Provide the Sentinel-2 tile shapefile"/> | |
109 </when> | |
110 </conditional> | |
111 <param type="data" name="input" format="shp" label="Shapefile with polygons" help="Provide shapefile with polygons"/> | |
112 <param name="identifier" type="text" value="PlotID" label="Name of identifier" /> | |
113 <section name="adv_options" title="Advanced options" expanded="false"> | |
114 <param name="start_date" type="text" optional="true" label="Time frame start date (YYYYMMDD)"> | |
115 <validator type="length" min="8" max="8" message="Please enter a date in the form of YYYYMMDD"/> | |
116 </param> | |
117 <param name="end_date" type="text" optional="true" label="Time frame end date (YYYYMMDD)"> | |
118 <validator type="length" min="8" max="8" message="Please enter a date in the form of YYYYMMDD"/> | |
119 </param> | |
120 <repeat name="statistics" title="Compute statistics" min="0"> | |
121 <conditional name="stats_input"> | |
122 <param name="stats" label="Statistics" type="select"> | |
123 <option value="mean">Mean</option> | |
124 <option value="sum">Sum</option> | |
125 <option value="min">Minimum</option> | |
126 <option value="max">Maximum</option> | |
127 <option value="std">Standard deviation</option> | |
128 <option value="median">Median</option> | |
129 <option value="majority">Majority</option> | |
130 <option value="minority">Minority</option> | |
131 <option value="unique">Unique</option> | |
132 <option value="range">Range</option> | |
133 <option value="percentile">Percentile</option> | |
134 </param> | |
135 <when value="mean"/> | |
136 <when value="sum"/> | |
137 <when value="min"/> | |
138 <when value="max"/> | |
139 <when value="std"/> | |
140 <when value="median"/> | |
141 <when value="majority"/> | |
142 <when value="minority"/> | |
143 <when value="unique"/> | |
144 <when value="range"/> | |
145 <when value="percentile"> | |
146 <param name="p_value" type="integer" value="0" min="0" max="100" label="percentile value (if percentile selected)" /> | |
147 </when> | |
148 </conditional> | |
149 </repeat> | |
150 <param name="indices" label="Indice to compute" type="select" multiple="true"> | |
151 <option value="ndvi">ndvi</option> | |
152 <option value="rvi">rvi</option> | |
153 <option value="savi">savi</option> | |
154 <option value="nbr">nbr</option> | |
155 <option value="kndvi">kndvi</option> | |
156 <option value="ndmi">ndmi</option> | |
157 <option value="mndwi">mndwi</option> | |
158 <option value="evi">evi</option> | |
159 <option value="evi2">evi2</option> | |
160 <option value="dvi">dvi</option> | |
161 <option value="cvi">cvi</option> | |
162 <option value="mcar">mcar</option> | |
163 <option value="ndi45">ndi45</option> | |
164 <option value="tctb">tctb</option> | |
165 <option value="tctg">tctg</option> | |
166 <option value="tctw">tctw</option> | |
167 <option value="ndwi">ndwi</option> | |
168 <option value="B02">B02</option> | |
169 <option value="B03">B03</option> | |
170 <option value="B04">B04</option> | |
171 <option value="B05">B05</option> | |
172 <option value="B06">B06</option> | |
173 <option value="B07">B07</option> | |
174 <option value="B08">B08</option> | |
175 <option value="B8A">B8A</option> | |
176 <option value="B11">B11</option> | |
177 <option value="B12">B12</option> | |
178 </param> | |
179 <param name="exclude_splitshp" type="boolean" checked="false" label="exclude splitshp" help="Flag to indicate that splitshp has been run manually beforehand" truevalue="--exclude_splitshp" falsevalue="" /> | |
180 <param name="exclude_border" type="boolean" checked="false" label="exclude border" help="Flag to indicate that border pixels (within the polygon) should be excluded from statistics calculations / array extraction" truevalue="--exclude_border" falsevalue="" /> | |
181 <param name="geotiff_out" type="boolean" checked="false" label="generate geotiffs" help="flag to indicate that geotiffs shall be extracted" truevalue="--geotiff_out" falsevalue="" /> | |
182 </section> | |
183 </inputs> | |
184 <outputs> | |
185 <data name="logfile" format="txt"/> | |
186 <collection name="csv_files" type="list" label="${tool.name} (statistics csv outputs)"> | |
187 <discover_datasets pattern="__name__" directory="results_csv" visible="false" format="tabular"/> | |
188 </collection> | |
189 </outputs> | |
190 <tests> | |
191 <test> | |
192 <conditional name="input_type"> | |
193 <param name="platform" value="tif" /> | |
194 <param name="input_file" ftype="tiff" value="smaller_area_20100401.tif" /> | |
195 </conditional> | |
196 <param name="input" value="test_polygons/test_polygons.html" ftype="shp"> | |
197 <composite_data value="test_polygons/test_polygons.shp"/> | |
198 <composite_data value="test_polygons/test_polygons.shx"/> | |
199 <composite_data value="test_polygons/test_polygons.dbf"/> | |
200 <composite_data value="test_polygons/test_polygons.prj"/> | |
201 </param> | |
202 <param name="identifier" value="id"/> | |
203 <section name="adv_options"> | |
204 <repeat name="statistics"> | |
205 <conditional name="stats_input"> | |
206 <param name="stats" value="mean"/> | |
207 </conditional> | |
208 </repeat> | |
209 <repeat name="statistics"> | |
210 <conditional name="stats_input"> | |
211 <param name="stats" value="percentile"/> | |
212 <param name="p_value" value="10"/> | |
213 </conditional> | |
214 </repeat> | |
215 <param name="exclude_splitshp" value="true"/> | |
216 </section> | |
217 <output file="20211213-104427.log" name="logfile" compare="sim_size" delta="100"/> | |
218 <output_collection name="csv_files" type="list" count="1"> | |
219 <element name="testrgb_20100401__statistics.csv" ftype="tabular" file="testrgb_20100401__statistics.csv" compare="diff" lines_diff="1"> | |
220 <assert_contents> | |
221 <has_text text="percentile_10" /> | |
222 <has_text text="20508" /> | |
223 <has_text text="12049" /> | |
224 <has_text text="4508" /> | |
225 <has_text text="110." /> | |
226 <has_text text="147." /> | |
227 <has_text text="32." /> | |
228 <has_n_columns n="4" /> | |
229 </assert_contents> | |
230 </element> | |
231 | |
232 | |
233 </output_collection> | |
234 </test> | |
235 <test> | |
236 <conditional name="input_type"> | |
237 <param name="platform" value="ls8" /> | |
238 <param name="input_file" ftype="tar" value="LS8.tar" /> | |
239 <param name="ls8_shp" ftype="shp" value="WRS2_descending/WRS2_descending.html"> | |
240 <composite_data value="WRS2_descending/WRS2_descending.shp"/> | |
241 <composite_data value="WRS2_descending/WRS2_descending.shx"/> | |
242 <composite_data value="WRS2_descending/WRS2_descending.dbf"/> | |
243 <composite_data value="WRS2_descending/WRS2_descending.prj"/> | |
244 </param> | |
245 </conditional> | |
246 <param name="input" value="test_parcels_32635/test_parcels_32635.html" ftype="shp"> | |
247 <composite_data value="test_parcels_32635/test_parcels_32635.shp"/> | |
248 <composite_data value="test_parcels_32635/test_parcels_32635.shx"/> | |
249 <composite_data value="test_parcels_32635/test_parcels_32635.dbf"/> | |
250 <composite_data value="test_parcels_32635/test_parcels_32635.prj"/> | |
251 </param> | |
252 <param name="identifier" value="ID"/> | |
253 <section name="adv_options"> | |
254 <repeat name="statistics"> | |
255 <conditional name="stats_input"> | |
256 <param name="stats" value="mean"/> | |
257 </conditional> | |
258 </repeat> | |
259 <repeat name="statistics"> | |
260 <conditional name="stats_input"> | |
261 <param name="stats" value="median"/> | |
262 </conditional> | |
263 </repeat> | |
264 <repeat name="statistics"> | |
265 <conditional name="stats_input"> | |
266 <param name="stats" value="std"/> | |
267 </conditional> | |
268 </repeat> | |
269 <param name="indices" value="ndvi"/> | |
270 </section> | |
271 <output file="20211218-102629.log" name="logfile" compare="sim_size" delta="100"/> | |
272 <output_collection name="csv_files" type="list" count="1"> | |
273 <element name="ndvi_20190628_189017_statistics.csv" ftype="tabular" file="ndvi_20190628_189017_statistics.csv" compare="diff" lines_diff="1"> | |
274 <assert_contents> | |
275 <has_text text="count" /> | |
276 <has_text text="32" /> | |
277 <has_text text="81" /> | |
278 <has_text text="48" /> | |
279 <has_text text=".384" /> | |
280 <has_text text=".304" /> | |
281 <has_text text=".424" /> | |
282 <has_text text=".387" /> | |
283 <has_text text=".295" /> | |
284 <has_text text=".432" /> | |
285 <has_text text=".033" /> | |
286 <has_text text=".078" /> | |
287 <has_text text=".031" /> | |
288 <has_n_columns n="5" /> | |
289 </assert_contents> | |
290 </element> | |
291 </output_collection> | |
292 </test> | |
293 <test> | |
294 <conditional name="input_type"> | |
295 <param name="platform" value="s2" /> | |
296 <param name="input_file" ftype="tar" value="S2.tar" /> | |
297 <param name="s2_shp" ftype="shp" value="sentinel2_tiles_world/sentinel2_tiles_world.html"> | |
298 <composite_data value="sentinel2_tiles_world/sentinel2_tiles_world.shp"/> | |
299 <composite_data value="sentinel2_tiles_world/sentinel2_tiles_world.shx"/> | |
300 <composite_data value="sentinel2_tiles_world/sentinel2_tiles_world.dbf"/> | |
301 <composite_data value="sentinel2_tiles_world/sentinel2_tiles_world.prj"/> | |
302 </param> | |
303 </conditional> | |
304 <param name="input" value="test_parcels_32635/test_parcels_32635.html" ftype="shp"> | |
305 <composite_data value="test_parcels_32635/test_parcels_32635.shp"/> | |
306 <composite_data value="test_parcels_32635/test_parcels_32635.shx"/> | |
307 <composite_data value="test_parcels_32635/test_parcels_32635.dbf"/> | |
308 <composite_data value="test_parcels_32635/test_parcels_32635.prj"/> | |
309 </param> | |
310 <param name="identifier" value="ID"/> | |
311 <section name="adv_options"> | |
312 <repeat name="statistics"> | |
313 <conditional name="stats_input"> | |
314 <param name="stats" value="mean"/> | |
315 </conditional> | |
316 </repeat> | |
317 <repeat name="statistics"> | |
318 <conditional name="stats_input"> | |
319 <param name="stats" value="median"/> | |
320 </conditional> | |
321 </repeat> | |
322 <repeat name="statistics"> | |
323 <conditional name="stats_input"> | |
324 <param name="stats" value="std"/> | |
325 </conditional> | |
326 </repeat> | |
327 <param name="indices" value="ndvi"/> | |
328 </section> | |
329 <output file="20211217-210343.log" name="logfile" compare="sim_size" delta="100"/> | |
330 <output_collection name="csv_files" type="list" count="1"> | |
331 <element name="ndvi_20200626_34VFN_statistics.csv" ftype="tabular" file="ndvi_20200626_34VFN_statistics.csv" compare="diff" lines_diff="1"> | |
332 <assert_contents> | |
333 <has_text text="204" /> | |
334 <has_text text="551" /> | |
335 <has_text text="335" /> | |
336 <has_text text=".321" /> | |
337 <has_text text=".293" /> | |
338 <has_text text=".661" /> | |
339 <has_text text=".302" /> | |
340 <has_text text=".294" /> | |
341 <has_text text=".686" /> | |
342 <has_text text=".091" /> | |
343 <has_text text=".088" /> | |
344 <has_text text=".091" /> | |
345 <has_n_columns n="5" /> | |
346 </assert_contents> | |
347 </element> | |
348 </output_collection> | |
349 </test> | |
350 </tests> | |
351 <help><![CDATA[ | |
352 | |
353 **EODIE - Earth Observation Data Information Extractor** | |
354 ======================================================================================================= | |
355 | |
356 Toolkit to extract object based timeseries from Earth Observation data such as Copernicus Sentinel 2, Landsat 8 and more generally geotiff files. | |
357 | |
358 EODIE takes the objects in as polygons in a shapefile as well as the timeframe of interest and the features (eg vegetation indices) to be extracted. | |
359 The output is a per polygon timeseries of the selected features over the timeframe of interest. | |
360 | |
361 ]]> </help> | |
362 <expand macro="citations" /> | |
363 </tool> |