-
Notifications
You must be signed in to change notification settings - Fork 1
/
red_list.xml
231 lines (210 loc) · 11.1 KB
/
red_list.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<tool id="srs_red_list" name="Red List assessement" version="@VERSION@" profile = "20.01">
<description>from remote sensing data</description>
<macros>
<import>macro.xml</import>
</macros>
<expand macro="SRS_requirements">
<requirement type="package" version="1.0.3">r-redlistr</requirement>
<requirement type="package" version="3.3.6">r-ggplot2</requirement>
<requirement type="package" version="1.1.1">r-cowplot</requirement>
<requirement type="package" version="2.3">r-gridextra</requirement>
<requirement type="package" version="1.5_29">r-rgdal</requirement>
<requirement type="package" version="0.1_11">r-tiff</requirement>
<requirement type="package" version="1.5.2">r-fs</requirement>
<requirement type="package" version="1.0_7">r-sf</requirement>
</expand>
<command detect_errors="exit_code"><![CDATA[
#import re
#if $mode.type_data.origin == 'envi_bil':
#set input_raster_1 = $mode.type_data.input_raster_1
#set input_raster_1_identifier = re.sub('[^\s\w\-]', '_', str($input_raster_1.element_identifier))
#set input_header_1 = $mode.type_data.input_header_1
#set input_header_1_identifier = re.sub('[^\s\w\-]+[^.hdr]', '_', str($input_header_1.element_identifier))
ln '${input_raster_1}' '${input_raster_1_identifier}' &&
ln '${input_header_1}' '${input_header_1_identifier}' &&
#else if $mode.type_data.origin == 'raster':
#set input_raster1 = $mode.type_data.input_raster1
#set input_raster1_identifier = str($input_raster1.element_identifier)
ln '${input_raster1}' '${input_raster1_identifier}' &&
#end if
#if $mode.criteria == 'A' and $mode.type_data.origin == 'envi_bil':
#set input_raster_2 = $mode.type_data.input_raster_2
#set input_raster_2_identifier = re.sub('[^\s\w\-]', '_', str($input_raster_2.element_identifier))
#set input_header_2 = $mode.type_data.input_header_2
#set input_header_2_identifier = re.sub('[^\s\w\-]+[^.hdr]', '_', str($input_header_2.element_identifier))
ln '${input_raster_2}' '${input_raster_2_identifier}' &&
ln '${input_header_2}' '${input_header_2_identifier}' &&
#else if $mode.criteria == 'A' and $mode.type_data.origin == 'raster':
#set input_raster2 = $mode.type_data.input_raster2
#set input_raster2_identifier = str($input_raster2.element_identifier)
ln '${input_raster2}' '${input_raster2_identifier}' &&
#end if
Rscript
'$__tool_directory__/red_list.r'
'$__tool_directory__/functions.r'
'$grid'
#if $mode.criteria == 'A' and $mode.type_data.origin == 'envi_bil':
'$input_raster_1_identifier'
'$input_header_1_identifier'
'$input_raster_2_identifier'
'$input_header_2_identifier'
''
''
''
''
#else if $mode.criteria == 'A' and $mode.type_data.origin == 'zipper':
''
''
''
''
'$mode.type_data.input1'
'$mode.type_data.input2'
''
''
#else if $mode.criteria == 'A' and $mode.type_data.origin == 'raster':
''
''
''
''
''
''
'$input_raster1_identifier'
'$input_raster2_identifier'
#else if $mode.criteria == 'B' and $mode.type_data.origin == 'envi_bil':
'$input_raster_1_identifier'
'$input_header_1_identifier'
''
''
''
''
''
''
#else if $mode.criteria == 'B' and $mode.type_data.origin == 'zipper':
''
''
''
''
'$mode.type_data.input1'
''
''
''
#else if $mode.criteria == 'B' and $mode.type_data.origin == 'raster':
''
''
''
''
''
''
'$input_raster1_identifier'
''
#end if
'$output_rli'
'$plots'
]]>
</command>
<inputs>
<param name="grid" type="text" label="Write down the grid size yo want to use for your assement" help="This parameter will vary if you do a Red List Ecosystem or Threatened Species (RLE or RLTS) assesament. For instance for 10x10km grid write 10000. For a RLE you should write 10000 (100km2) and for a RLTS 400 (4km2)."/>
<conditional name="mode">
<param name="criteria" type="select" label="Which one of those criteria do you want to compute ?" display="radio" help="Criterion A temporal assesment and B spatial assesment">
<option value="A">Criterion A</option>
<option value="B">Criterion B</option>
</param>
<when value="A">
<conditional name="type_data">
<param name="origin" type="select" label="In which format are your data ?">
<option value="zipper">The data you are using are in a zip folder Reflectance</option>
<option value="envi_bil">Your already have the files in ENVI BIL format</option>
<option value="raster">You have your data in a raster format : tif, ...</option>
</param>
<when value="zipper">
<param name="input1" type="data" format="zip" multiple="true" label="Input data 1"/>
<param name="input2" type="data" format="zip" multiple="true" label="Input data 2"/>
</when>
<when value="envi_bil">
<param name="input_raster_1" type="data" format="bil" label="Input raster 1"/>
<param name="input_header_1" type="data" format="hdr" label="Input header 1"/>
<param name="input_raster_2" type="data" format="bil" label="Input raster 2"/>
<param name="input_header_2" type="data" format="hdr" label="Input header 2"/>
</when>
<when value="raster">
<param name="input_raster1" type="data" format="tiff, shp, kml" label="Input data 1"/>
<param name="input_raster2" type="data" format="tiff, shp, kml" label="Input data 2"/>
</when>
</conditional>
</when>
<when value="B">
<conditional name="type_data">
<param name="origin" type="select" label="In which format are your data ?">
<option value="zipper">The data you are using are in a zip folder Reflectance</option>
<option value="envi_bil">Your already have the files in ENVI BIL format</option>
<option value="raster">You have your data in a raster format : tif, shp and kml</option>
</param>
<when value="zipper">
<param name="input1" type="data" format="zip" multiple="true" label="Input data 1"/>
</when>
<when value="envi_bil">
<param name="input_raster_1" type="data" format="bil" label="Input raster 1"/>
<param name="input_header_1" type="data" format="hdr" label="Input header 1"/>
</when>
<when value="raster">
<param name="input_raster1" type="data" format="tiff, shp, xml" label="Input data 1"/>
</when>
</conditional>
</when>
</conditional>
</inputs>
<outputs>
<data name="output_rli" from_work_dir="report.txt" format="txt" label="Red list criterion ${mode.criteria} report"/>
<collection type="list" name="plots" label="Criterion ${mode.criteria} plot">
<discover_datasets pattern="(?P<designation>.+)\.png" visible="false" format="png"/>
</collection>
</outputs>
<tests>
<test>
<param name="grid" value="10000"/>
<param name="criteria" value="A"/>
<param name="origin" value="raster"/>
<param name="input_raster1" value="example_distribution_2000.tif"/>
<param name="input_raster2" value="example_distribution_2017.tif"/>
<output name="output_rli">
<assert_contents>
<has_n_columns n="1"/>
</assert_contents>
</output>
<output_collection name="plots" type="list" count="2"/>
</test>
</tests>
<help><![CDATA[
=================================================================
Conduct Red List assessement according to IUCN redlist guidelines
=================================================================
**What it does**
This tool assess the spatial criteria of the **IUCN Red List of Ecosystems** (http://iucnrle.org/). These criteria assess the change in the extent of an ecosystem over time (Criterion A) and properties of the geographic distribution size (Criterion B). Both of these criteria require the use of maps of ecosystem distributions.
**Input description**
- The cells' size : a minimum threshold before a cell is deemed occupied. For the purposes of red listing, ecosystem cells are 100km² and species cells are 4km².
It expects an image file as input, with a specific data format. ENVI HDR image with BIL interleave required.
The image is an ENVI raster including :
- A binary file (which has no extension here).
- A header file (with .hdr extension).
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.
In order to get such input we advise to use the tool preprocessing sentinel 2 data.
+--------------+----------+
| BIL | ENVI HDR |
+==============+==========+
| raster stack | Metadata |
+--------------+----------+
| ... | ... |
+--------------+----------+
**Output**
- Multiple png graph
- 1 text file
**Criterion A**
At two time points, this tool computes three rate of change statistics to enable users to extrapolate estimates from limited data to the time frames required by Red List guidelines. The rates are absolute rate of decline (ARD), proportional rate of decline (PRD), and annual rate of change (ARC)
The functions are statistical methods for estimating decline using data at only two time points.
**Criterion B**
This tool's part utilizes measures of the geographic distribution of an ecosystem type to identify ecosystems that are at risk from catastrophic disturbances. This is done using two standardized metrics: the extent of occurrence (EOO) and the area of occupancy (AOO)
]]> </help>
<citations>
<citation type="doi">doi:10.1111/ecog.04143</citation>
</citations>
</tool>