Sentinel-2 Workflow of Workflow
CWL can run sub-workflows in a step.
To process a list of STAC Items and then generate a STAC catalog with several detected water bodies, the flowchart is:
graph TB
A["[STAC Item URL, STAC Item URL]"]
A --> F
A --> B(("crop(green)"));
A--> C(("crop(nir)"));
subgraph scatter on STAC Items
P[bands]
Q[EPSG code]
R[AOI]
subgraph scatter on bands
P --> B(("crop(green)"))
P --> C(("crop(nir)"))
Q --> B(("crop(green)"))
Q --> C(("crop(nir)"))
R --> B(("crop(green)"))
R --> C(("crop(nir)"))
end
B(("crop(green)")) --> D
C(("crop(nir)")) --> D
D(("`Normalized
difference`"));
D --> E(("`Otsu
threshold`"))
end
E --> F
F(("`Create
STAC Catalog`"))
Below a CWL Workflow implementing this scenario:
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 |
|
The stac
CommandLineTool is updated to manage arrays:
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 |
|
To run this CWL document, one would do:
export WORKSPACE=/workspace/app-package-training-bids23
cwltool \
--podman \
--outdir /workspace/runs \
${WORKSPACE}/cwl-workflow/app-water-bodies-cloud-native.cwl \
--stac_items "https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a-cogs/items/S2B_10TFK_20210713_0_L2A" \
--stac_items "https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a-cogs/items/S2A_10TFK_20220524_0_L2A" \
--aoi="-121.399,39.834,-120.74,40.472" \
--epsg "EPSG:4326"