comparison alpha_beta.xml @ 0:9adccd3da70c 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:37:37 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9adccd3da70c
1 <tool id="srs_diversity_maps" name="Map diversity" version="@VERSION@" profile="20.01">
2 <description>from remote sensing data</description>
3 <macros>
4 <import>macro.xml</import>
5 </macros>
6 <expand macro="SRS_requirements">
7 </expand>
8 <command detect_errors="exit_code"><![CDATA[
9 #import re
10 #if $method.origin == 'envi_bil':
11 #set input_raster = $method.input_raster
12 #set input_raster_identifier = re.sub('[^\s\w\-]', '_', str($input_raster.element_identifier))
13 #set input_header = $method.input_header
14 #set input_header_identifier = re.sub('[^\s\w\-]+[^.hdr]', '_', str($input_header.element_identifier))
15 cp '${input_raster}' '${input_raster_identifier}' &&
16 cp '${input_header}' '${input_header_identifier}' &&
17 #end if
18 Rscript
19 '$__tool_directory__/alpha_beta.r'
20 #if $method.origin == 'envi_bil':
21 '$input_raster_identifier'
22 '$input_header_identifier'
23 ''
24 #else:
25 ''
26 ''
27 '$method.input'
28 #end if
29 '$typepca'
30 #if $type == 'alpha':
31 'TRUE'
32 'FALSE'
33 'FALSE'
34 'FALSE'
35 #else if $type == 'beta':
36 'FALSE'
37 'TRUE'
38 'FALSE'
39 'FALSE'
40 #else if $type == 'funct':
41 'FALSE'
42 'FALSE'
43 'TRUE'
44 'FALSE'
45 #else:
46 'FALSE'
47 'FALSE'
48 'FALSE'
49 'TRUE'
50 #end if
51 \${GALAXY_SLOTS:-1}
52 '$__tool_directory__/functions.r'
53 '$output_alpha'
54 '$output_beta'
55 '$output_funct'
56 '$plots'
57 ]]>
58 </command>
59 <inputs>
60 <conditional name="method">
61 <param name="origin" type="select" label="In which format are your data ?">
62 <option value="zipper">The data you are using are in a zip folder Reflectance</option>
63 <option value="envi_bil">Your already have the files in ENVI BIL format</option>
64 </param>
65 <when value="zipper">
66 <param name="input" type="data" format="zip" multiple="true" label="Input data"/>
67 </when>
68 <when value="envi_bil">
69 <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"/>
70 <param name="input_header" type="data" format="hdr" label="Input header"/>
71 </when>
72 </conditional>
73 <param name="typepca" type="select" label="Do you want to do a PCA or a SPCA ?" display="radio" help="If you choose PCA there is no rescaling of the data as oppposed as if you choose SPCA">
74 <option value="SPCA">SPCA</option>
75 <option value="PCA">PCA</option>
76 </param>
77 <param name="type" type="select" label="Alpha, beta, functional diversity and comparison plot and map" display="radio">
78 <option value="alpha">Alpha diversity map</option>
79 <option value="beta">Beta diversity map</option>
80 <option value="funct">Functional diversity map</option>
81 <option value="all">All of the above</option>
82 </param>
83 </inputs>
84 <outputs>
85 <data name="output_alpha" from_work_dir="alpha.tabular" format="tabular" label="Alpha diversity">
86 <filter> type == 'alpha' or type == 'all'</filter>
87 </data>
88 <data name="output_beta" from_work_dir="beta.tabular" format="tabular" label="Beta diversity">
89 <filter> type == 'beta' or type == 'all'</filter>
90 </data>
91 <data name="output_funct" from_work_dir="Functionnal.tabular" format="tabular" label="Functionnal diversity">
92 <filter> type == 'funct' or type == 'all'</filter>
93 </data>
94 <collection type="list" name="plots" label="${type} plot">
95 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" visible="false" format="png"/>
96 </collection>
97 </outputs>
98 <tests>
99 <test>
100 <param name="origin" value="envi_bil"/>
101 <param name="input_raster" value="S2A_Subset"/>
102 <param name="input_header" value="S2A_Subset.hdr"/>
103 <param name="type" value="alpha"/>
104 <output name="output_alpha">
105 <assert_contents>
106 <has_n_columns n="3"/>
107 </assert_contents>
108 </output>
109 <output_collection name="plots" type="list" count="1"/>
110 </test>
111 </tests>
112 <help><![CDATA[
113 ========================================================================
114 Process satellite remote sensing data to produce biodiversity indicators
115 ========================================================================
116
117
118 **What it does**
119
120 FĂ©ret and Asner (2014) developed a method for **tropical forest** diversity mapping based on very high spatial resolution airborne imaging spectroscopy.
121
122 The goal of this tool using the package biodivMapR is to produce (spectral) diversity maps based on (optical) images.
123
124 **Input description**
125
126 It expects an image file as input, with a specific data format. ENVI HDR image with BIL interleave required.
127 The image is an ENVI raster including :
128
129 - A binary file (which has no extension here).
130
131 - A header file (with .hdr extension).
132
133 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.
134
135 In order to get such input we advise to use the tool preprocessing sentinel 2 data.
136
137 +--------------+----------+
138 | BIL | ENVI HDR |
139 +==============+==========+
140 | raster stack | Metadata |
141 +--------------+----------+
142 | ... | ... |
143 +--------------+----------+
144
145 **Output**
146
147 - Three tabulars : alpha, beta, functionnal each of them with 3 colomns latitude, longitude and the indice.
148
149 - Three png graph for each indice
150
151 ]]></help>
152 <expand macro="SRS_BDMRref"/>
153 </tool>