comparison biodiv_indices_global.xml @ 0:5cae678042ec draft default tip

planemo upload for repository https://github.com/Marie59/Sentinel_2A/srs_tools commit b32737c1642aa02cc672534e42c5cb4abe0cd3e7
author ecology
date Mon, 09 Jan 2023 13:36:33 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5cae678042ec
1 <tool id="srs_global_indices" name="Compute biodiversity indices" version="@VERSION@" profile = "20.01">
2 <description>from remote sensing data</description>
3 <macros>
4 <import>macro.xml</import>
5 </macros>
6 <requirements>
7 <requirement type="package" version="4.2.2">r-base</requirement>
8 <requirement type="package" version="3.5_21">r-raster</requirement>
9 <requirement type="package" version="1.5_32">r-rgdal</requirement>
10 <requirement type="package" version="1.5_1">r-sp</requirement>
11 <requirement type="package" version="0.3.1">r-rasterdiv</requirement>
12 <requirement type="package" version="3.4.0">r-ggplot2</requirement>
13 <!--requirement type="package" version="1.5_21">r-terra</requirement-->
14 </requirements>
15 <command detect_errors="exit_code"><![CDATA[
16 #import re
17 #if $method.type == 'envi_bil':
18 #set input_raster = $method.input_raster
19 #set input_raster_identifier = re.sub('[^\s\w\-]', '_', str($input_raster.element_identifier))
20 #set input_header = $method.input_header
21 #set input_header_identifier = re.sub('[^\s\w\-]+[^.hdr]', '_', str($input_header.element_identifier))
22 cp '${input_raster}' '${input_raster_identifier}' &&
23 cp '${input_header}' '${input_header_identifier}' &&
24 #end if
25 Rscript
26 '$__tool_directory__/biodiv_indices_global.r'
27 #if $method.type == 'envi_bil':
28 '$input_raster_identifier'
29 '$input_header_identifier'
30 ''
31 #else:
32 ''
33 ''
34 '$method.input'
35 #end if
36 '$alpha'
37 '$__tool_directory__/functions.r'
38 '$output_indices'
39 '$plots_png'
40 ]]>
41 </command>
42 <inputs>
43 <conditional name="method">
44 <param name="type" type="select" label="In which format are your data ?">
45 <option value="zipper">The data you are using are in a zip folder Reflectance</option>
46 <option value="envi_bil">Your already have the files in ENVI BIL format</option>
47 </param>
48 <when value="zipper">
49 <param name="input" type="data" format="zip" multiple="true" label="Input data"/>
50 </when>
51 <when value="envi_bil">
52 <param name="input_raster" type="data" format="bil" label="Input raster" help="It can be the raw data in bil or the PCA raster layer in bil"/>
53 <param name="input_header" type="data" format="hdr" label="Input header"/>
54 </when>
55 </conditional>
56 <param name="alpha" type="text" label="Write a number of the value of alpha you want to calculate Renyi, Prao and Hill indicators (between 0 and 5)"/>
57 </inputs>
58 <outputs>
59 <data name="output_indices" from_work_dir="BiodivIndex.tabular" format="tabular" label="Biodiversity indices tabular">
60 </data>
61 <collection type="list" name="plots_png" label="Biodiversity indices plots">
62 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" visible="false" format="png"/>
63 </collection>
64 </outputs>
65 <tests>
66 <test>
67 <param name="type" value="envi_bil"/>
68 <param name="input_raster" value="S2A_Subset"/>
69 <param name="input_header" value="S2A_Subset.hdr"/>
70 <param name="alpha" value="1"/>
71 <output name="output_indices">
72 <assert_contents>
73 <has_n_lines n="2501"/>
74 </assert_contents>
75 </output>
76 <output_collection name="plots_png" type="list" count="7"/>
77 </test>
78 </tests>
79 <help><![CDATA[
80 =========================================================================
81 Computes global biodiversity indices from satellite remote sensing data
82 =========================================================================
83
84
85 **What it does**
86
87 This tool aims to provide functions to apply Information Theory based diversity indexes on RasterLayer such as Shannon's entropy or Cumulative Residual Entropy (CRE).
88
89
90 **Input description**
91
92 It expects an image file as input, with a specific data format. ENVI HDR image with BIL interleave required.
93 The image is an ENVI raster including :
94
95 - A binary file (which has no extension here).
96
97 - A header file (with .hdr extension).
98
99 The header file is a text file including all necessary metadata which can be read with a text editor. It includes image dimensions, projection, and the name and central wavelength for each spectral band.
100
101 In order to get such input we advise to use the tool preprocessing sentinel 2 data. If you did so you can directly enter the "Reflectance" output from this tool and thus select the otpion "The data you are using are in a zip folder Reflectance".
102
103 ⚠️ If you do not use this Reflectance folder make sure that your data are respectively in bil and hdr format in the datatypes.
104
105 - A number for the alpha indice which used to calculate the following indicators : Renyi, Hill and Prao.
106
107 +--------------+----------+---------------+
108 | BIL | ENVI HDR | Number alpha |
109 +==============+==========+===============+
110 | raster stack | Metadata | 1 |
111 +--------------+----------+---------------+
112 | ... | ... | ... |
113 +--------------+----------+---------------+
114
115 **Output**
116
117 - One tabular with 9 columns longitude, latitude columns and one for each indices.
118
119 - Seven png graph one for each indices.
120
121 ]]> </help>
122 <expand macro="SRS_rasterdivref"/>
123 </tool>