generated from snap-contrib/cwl-snap-graph-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpt-stac-topsar-stac.cwl
331 lines (317 loc) · 8.19 KB
/
gpt-stac-topsar-stac.cwl
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
$graph:
- baseCommand: stac2safe
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: docker.terradue.com/stac2safe:latest
id: stac2safe
stdout: message
arguments:
- -p
- sar:product_type=SLC
- -p
- mission=sentinel-1
inputs:
input_reference:
inputBinding:
position: 1
prefix: --input_reference
type: Directory
outputs:
results:
type: string
outputBinding:
glob: message
loadContents: true
outputEval: $(self[0].contents.split('\n')[0])
requirements:
EnvVarRequirement:
envDef:
PATH: /srv/conda/envs/env_stac2safe/bin:/srv/conda/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
ResourceRequirement: {}
- baseCommand: insar-dim2stac
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: docker.terradue.com/insar-dim2stac:latest
id: dim2stac
inputs:
inp1:
inputBinding:
position: 1
prefix: --input-dimap
type: Directory
inp2:
inputBinding:
position: 2
prefix: --primary
type: Directory
inp3:
inputBinding:
position: 3
prefix: --secondary
type: Directory
outputs:
results:
outputBinding:
glob: .
type: Directory
requirements:
EnvVarRequirement:
envDef:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/conda/envs/env_dim2stac/bin:/srv/conda/envs/env_dim2stac/snap/bin
ResourceRequirement: {}
stderr: std.err
stdout: std.out
- baseCommand: gpt
hints:
DockerRequirement:
dockerPull: docker.terradue.com/snap-gpt:latest
class: CommandLineTool
id: ifg
arguments:
- prefix: -PoutFile=
separate: false
valueFrom: |
${
return 'IW_ifg.dim';
}
- valueFrom: "/graphs/topsar/read-split-ifg.xml"
position: 4
inputs:
inp1:
inputBinding:
position: 1
prefix: -PinFileP=
separate: false
valueFrom: ${ return inputs.inp1.path + inputs.inp3 + '/manifest.safe'; }
type: Directory
inp2:
inputBinding:
position: 2
prefix: -PinFileS=
separate: false
valueFrom: ${ return inputs.inp2.path + inputs.inp4 + '/manifest.safe'; }
type: Directory
inp3:
type: string
inp4:
type: string
inp5:
inputBinding:
position: 3
prefix: -PsubSwath=
separate: false
type: string
outputs:
results:
outputBinding:
glob: .
type: Directory
requirements:
EnvVarRequirement:
envDef:
PATH: /srv/conda/envs/env_snap/snap/bin:/usr/share/java/maven/bin:/usr/share/java/maven/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/opt/anaconda/bin:/usr/lib64/qt-3.3/bin:/usr/share/java/maven/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
JAVA_HOME: /srv/conda/envs/env_snap/snap/jre
HOME: /tmp
SNAP_HOME: /tmp/.snap
ResourceRequirement: {}
InlineJavascriptRequirement: {}
#stderr: std.err
#stdout: std.out
- baseCommand: gpt
hints:
DockerRequirement:
dockerPull: docker.terradue.com/snap-gpt:latest
class: CommandLineTool
id: merge
arguments:
- valueFrom: | #"/graphs/topsar/topsar-merge-write.xml"
${
var array = [inputs.inp1, inputs.inp2, inputs.inp3];
var filtered = array.filter(function (el) {
return el != "";
});
switch(filtered.length) {
case 1:
return "/graphs/topsar/topsar-merge-write-1-swath.xml"
break;
case 2:
return "/graphs/topsar/topsar-merge-write-2-swaths.xml"
break;
default:
return "/graphs/topsar/topsar-merge-write-all-swaths.xml"
}
}
position: 4
inputs:
inp1:
inputBinding:
position: 1
prefix: -PinFile1=
separate: false
valueFrom: ${ return inputs.inp1.path + '/IW_ifg.dim'; }
type: Directory
inp2:
inputBinding:
position: 2
prefix: -PinFile2=
separate: false
valueFrom: ${ if ( inputs.inp2 != "")
return inputs.inp2.path + '/IW_ifg.dim';
else
return inputs.inp2;
}
type: [string, Directory]
inp3:
inputBinding:
position: 3
prefix: -PinFile3=
separate: false
valueFrom: ${ if ( inputs.inp3 != "")
return inputs.inp3.path + '/IW_ifg.dim';
else
return inputs.inp3;
}
type: [string, Directory]
outputs:
results:
outputBinding:
glob: .
type: Directory
requirements:
EnvVarRequirement:
envDef:
PATH: /srv/conda/envs/env_snap/snap/bin:/usr/share/java/maven/bin:/usr/share/java/maven/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/opt/anaconda/bin:/usr/lib64/qt-3.3/bin:/usr/share/java/maven/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
JAVA_HOME: /srv/conda/envs/env_snap/snap/jre
HOME: /tmp
SNAP_HOME: /tmp/.snap
ResourceRequirement: {}
InlineJavascriptRequirement: {}
#stderr: std.err
#stdout: std.out
- class: Workflow
doc: SNAP SAR Calibration
id: main
inputs:
subswath:
type:
type: enum
symbols:
- "IW1"
- "IW2"
- "IW3"
- "IW1,IW2"
- "IW2,IW3"
- "IW1,IW2,IW3"
primary:
doc: Sentinel-1 SLC primary product SAFE Directory
label: Sentinel-1 SLC primary product SAFE Directory
type: Directory
secondary:
doc: Sentinel-1 SLC secondary product SAFE Directory
label: Sentinel-1 SLC secondary product SAFE Directory
type: Directory
label: SNAP SAR Calibration
outputs:
- id: wf_outputs
outputSource:
- node_3/results
type: Directory
requirements:
- class: ScatterFeatureRequirement
- class: SubworkflowFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
steps:
generate_swath:
requirements:
- class: InlineJavascriptRequirement
run:
class: ExpressionTool
inputs:
subswath:
type:
type: enum
symbols:
- "IW1"
- "IW2"
- "IW3"
- "IW1,IW2"
- "IW2,IW3"
- "IW1,IW2,IW3"
outputs:
swaths:
type: string[]
expression: |
${
return { "swaths": inputs.subswath.split(",") }
}
in:
subswath: subswath
out:
- swaths
node_01:
in:
input_reference: primary
out:
- results
run: '#stac2safe'
node_02:
in:
input_reference: secondary
out:
- results
run: '#stac2safe'
node_1:
in:
inp1: primary
inp2: secondary
inp3: node_01/results
inp4: node_02/results
inp5: generate_swath/swaths
out:
- results
run: '#ifg'
scatter: inp5
scatterMethod: dotproduct
node_2:
in:
inp1:
source: node_1/results
valueFrom: |
${
return self[0];
}
inp2:
source: node_1/results
valueFrom: |
${
if (self.length >= 2)
return self[1];
else
return "";
}
inp3:
source: node_1/results
valueFrom: |
${
if (self.length >= 3)
return self[2];
else
return "";
}
out:
- results
run: '#merge'
node_3:
in:
inp1:
source: node_2/results
valueFrom: ${ return self }
inp2: primary
inp3: secondary
out:
- results
run: '#dim2stac'
cwlVersion: v1.0