Skip to content

Commit

Permalink
ls9 exec
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricebrito committed Nov 2, 2023
1 parent 9fed2b9 commit cb2655b
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 3 deletions.
68 changes: 66 additions & 2 deletions docs/cwl-workflow/exec-stage-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,82 @@ scripts/cwl-cli-stage-in-released.sh
sh ${WORKSPACE}/scripts/cwl-cli-stage-in-released.sh
```

The expected content after this step is:

```bash
(base) jovyan@coder-fbrito:~/runs$ tree
.
├── app-water-body.1.0.0.cwl
├── lwft9j0o
│ ├── LC09_L2SP_042033_20231015_02_T1
│ │ ├── LC09_L2SP_042033_20231015_02_T1.json
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ANG.txt
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_MTL.json
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_MTL.txt
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_MTL.xml
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_QA_PIXEL.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_QA_RADSAT.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B1.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B2.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B3.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B4.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B5.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B6.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_B7.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_SR_QA_AEROSOL.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_ATRAN.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_B10.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_CDIST.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_DRAD.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_EMIS.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_EMSD.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_QA.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_TRAD.TIF
│ │ ├── LC09_L2SP_042033_20231015_20231016_02_T1_ST_URAD.TIF
│ │ ├── preview.png
│ │ └── tilejson.json
│ ├── catalog.json
│ └── stage.py
└── staged.json

2 directories, 30 files
```

The result is redirected to a file named `staged.json` as we use `jq` to get the path of the staged product:

```bash title="terminal"
cat staged.json | jq -r .staged
cat staged.json | jq -r .staged.path
```

This returns a path like `/workspace/runs/921x91vw`

### Step 4 - Execute the Application Package

Use `cwltool` to run the application package using the staged Landsat-9 acquisition:

```bash linenums="1" hl_lines="5"
--8<--
scripts/cwl-workflow-staged.sh
scripts/exec-app-water-body.sh
--8<--
```

```
sh ${WORKSPACE}/scripts/exec-app-water-body.sh
```

### Expected outcome

The folder `/workspace/runs` contains:

``` hl_lines="3"
(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
```
2 changes: 1 addition & 1 deletion docs/cwl-workflow/stage-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ scripts/cwl-cli-stage-in.sh
The result is redirected to a file named `staged.json` as we use `jq` to get the path of the staged product:

```bash title="terminal"
cat staged.json | jq -r .staged
cat staged.json | jq -r .staged.path
```

This returns a path like `/workspace/runs/921x91vw`
11 changes: 11 additions & 0 deletions scripts/exec-app-water-body.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version="1.0.0"

cwltool \
--podman \
--outdir /workspace/runs \
/workspace/runs/app-water-body.${version}.cwl \
--item $( cat staged.json | jq -r .staged.path ) \
--aoi="-118.985,38.432,-118.183,38.938" \
--epsg "EPSG:4326" \
--bands green \
--bands nir08

0 comments on commit cb2655b

Please sign in to comment.