Skip to content

Sentinel-2

Goal

Run the app-water-body-cloud-native.1.0.0.cwl released application package using cwltool.

Step 1 - Configure the workspace

The results produced will be available in the local folder /workspace/runs

terminal
1
2
3
4
export WORKSPACE=/workspace/app-package-training-bids23
export RUNTIME=/workspace/runs
mkdir -p ${RUNTIME}
cd ${RUNTIME}
source /workspace/app-package-training-bids23/scripts/setup.sh

Step 2 - Download the released Application package

scripts/download-app-water-body-cloud-native.sh
1
2
3
4
5
version="1.0.0"

wget \
    -O /workspace/runs/app-water-body-cloud-native.${version}.cwl \
    https://github.com/Terradue/app-package-training-bids23/releases/download/${version}/app-water-body-cloud-native.${version}.cwl
sh ${WORKSPACE}/scripts/download-app-water-body-cloud-native.sh

Step 3 - Execute the Application Package

scripts/exec-app-water-body-cloud-native.sh
1
2
3
4
5
6
7
8
9
version="1.0.0"

cwltool \
    --podman \
    --outdir /workspace/runs \
    /workspace/runs/app-water-body-cloud-native.${version}.cwl \
    --item "https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a-cogs/items/S2B_10TFK_20210713_0_L2A" \
    --aoi="-121.399,39.834,-120.74,40.472" \
    --epsg "EPSG:4326"
sh ${WORKSPACE}/scripts/exec-app-water-body-cloud-native.sh

Expected outcome

The folder /workspace/runs contains:

(base) jovyan@coder-fbrito:~/runs$ tree .
/workspace/runs/
├── app-water-body-cloud-native.1.0.0.cwl
└── cmtriamc
    ├── S2B_10TFK_20210713_0_L2A
    │   ├── S2B_10TFK_20210713_0_L2A.json
    │   └── otsu.tif
    └── catalog.json

2 directories, 4 files