12  LCZ Full Pipeline

12.1 Introduction

The following sections demonstrate that the HEATWISE Local Climate Zones classification (full pipeline) software follows the OGC Best Practice for Earth Observation Application Package.

The pipeline runs all steps of the LCZ classification, including model training, in one workflow.

The order of demonstration is deliberately different from that given in the best practice document. This is done to make the demonstration easy to follow and group requirements that can be shown together. An effort is made to keep the requirements in order as much as possible to make it easy to find a specific requirement.

The demonstration proceeds in the following steps:

  • Execute the software as docker container and as CWL document (the EOAP)
  • Show that STAC inputs and outputs are handled by the application as required
  • Show that the CWL document is structured as required
  • Show that STAC inputs and outputs are declared in the CWL as required

After each step, the requirements shown are listed.

Chapter 2 contains an overview of all requirements in order and how they are demonstrated in this document. It furthermore shows all utility scripts used in this demonstration. For brevity, the content of utility scripts is only shown in the requirements overview and not in each demonstration.

12.2 Preparation

Activate the pixi environment to make validation tools and scripts available.

eval "$(pixi shell-hook --change-ps1 false)"

Set environment variables to software, cwl documents, inputs and outputs.

set -o pipefail
set -x
SOFTWARE_ROOT="$PIXI_PROJECT_ROOT"/software/heatwise-lcz-pipeline
CWL_PATH="$PIXI_PROJECT_ROOT"/application-packages/heatwise_pipeline.cwl
INPUT_PATH="$PIXI_PROJECT_ROOT"/inputs/lcz-pipeline

OUTPUT_PATH="$PIXI_PROJECT_ROOT"/outputs/lcz-pipeline

ls -ltrAh --color=never "$SOFTWARE_ROOT"
set +x
+ SOFTWARE_ROOT=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline
+ CWL_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl
+ INPUT_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline
+ OUTPUT_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline
+ ls --color=auto -ltrAh --color=never /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline
total 48K
-rw-r--r-- 1 runner runner  169 Nov 27 10:37 .gitignore
-rw-r--r-- 1 runner runner 9.9K Nov 27 10:37 README.md
-rw-r--r-- 1 runner runner 1.1K Nov 27 10:37 LICENSE
-rw-r--r-- 1 runner runner  344 Nov 27 10:37 .dockerignore
drwxr-xr-x 4 runner runner 4.0K Nov 27 10:37 data
drwxr-xr-x 2 runner runner 4.0K Nov 27 10:37 examples
-rw-r--r-- 1 runner runner 4.9K Nov 27 10:37 heatwise_pipeline.cwl
-rw-r--r-- 1 runner runner  343 Nov 27 10:37 requirements.txt
drwxr-xr-x 7 runner runner 4.0K Nov 27 10:37 .git
+ set +x

12.3 Running the software

The first set of requirements is concerned with how the software is executed. It shall be

  • Runnable as a non-interactive script
  • Bundled in (Docker) container
  • Executable as a CWL Workflow containing at least one CWL CommandLineTool

12.3.1 Running as a docker container

The LCZ pipeline combines the processing steps showcased in the last three chapters:

  1. LCZ Preprocessing Chapter 9
  2. LCZ Patch extraction Chapter 10
  3. LCZ Classification Chapter 11

Running the individual container images directly with docker run is shown in these chapters. The pipeline additionally uses pipeline-specific variants of some of the images. For this EOAP, the non-interactive execution of all containers (Requirements 1 and 2) is demonstrated by the successful execution of the workflow with cwltool in the next section.

The container images referenced in the CWL CommandLineTools are extracted from the CWL document, and each is checked to be available in a container registry:

DOCKER_IMAGE_IDS=$(yq -r '.["$graph"][] | select(.class == "CommandLineTool") | (.requirements // [])[] | select(.class == "DockerRequirement") | .dockerPull' "$CWL_PATH" | sort -u)
[[ -n "$DOCKER_IMAGE_IDS" ]] || { echo "FAILURE: No container images found in CWL document"; FAIL_REQ_3=1; }

for DOCKER_IMAGE_ID in $DOCKER_IMAGE_IDS; do
    check-container-registry.sh "$DOCKER_IMAGE_ID" || FAIL_REQ_3=1
done
SUCCESS: Image ghcr.io/esa-heatwise/heatwise-hsi-lst-prep:1.0.0 found on registry
SUCCESS: Image ghcr.io/esa-heatwise/heatwise-lcz-classification-pipeline:1.0.0 found on registry
SUCCESS: Image ghcr.io/esa-heatwise/heatwise-lcz-classification:1.0.0 found on registry
SUCCESS: Image ghcr.io/esa-heatwise/heatwise-patch-extraction-pipeline:1.0.0 found on registry

12.3.1.1 Requirements Validated

req/app/container (Requirement 2)

The environment, libraries, binaries, executable and configuration files necessary to execute the Application SHALL be bundled in a container image.

req/app/registry (Requirement 3)

The Application container image SHALL be accessible in a container registry.

12.3.2 Running as an EOAP

First, we validate that the CWL document is valid.

cwltool --disable-color --validate "$CWL_PATH" | cat
INFO /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/.pixi/envs/dev/bin/cwltool 3.2.20260413085819
INFO Resolved '/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl' to 'file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl'
/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl is valid CWL.

The CWL should contain a Workflow and at least one CommandLineTool object. We inspect the classes in the CWL graph to make sure.

show-cwl-graph-classes.sh "$CWL_PATH"
class: Workflow
id: '#main'
---
class: CommandLineTool
id: '#extract_patches_pipeline.cwl'
---
class: CommandLineTool
id: '#hsi_lst_prep.cwl'
---
class: CommandLineTool
id: '#lcz_train.cwl'
---
class: CommandLineTool
id: '#predict_pipeline.cwl'

The EOAP can be executed from its CWL description with cwltool.

cwltool \
  --disable-color \
  --outdir "$OUTPUT_PATH/cwlruns" \
   $CWL_PATH \
   --prep_config $SOFTWARE_ROOT/examples/run_all_config_docker.yaml \
   --prep_input_catalog $INPUT_PATH/Berlin_prep \
   --sentinel2 $INPUT_PATH/Berlin_prep/Berlin_S2.tif \
   --patch_config_template $SOFTWARE_ROOT/examples/patch_config_template.yaml \
   --labels_dir $INPUT_PATH/Berlin_labels \
   --labels_basename Berlin_labels \
   --train_config $SOFTWARE_ROOT/examples/train_config_sample.yaml \
   --predict_config $SOFTWARE_ROOT/examples/predict_config_template.yaml \
   --experiment_name HSI-BS \
  || { FAIL_REQ_1=1; FAIL_REQ_2=1; FAIL_REQ_7=1; }
INFO /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/.pixi/envs/dev/bin/cwltool 3.2.20260413085819
INFO Resolved '/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl' to 'file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/heatwise_pipeline.cwl'
INFO [workflow ] start
INFO [workflow ] starting step prep
INFO [step prep] start
INFO [job prep] /tmp/ge_y_z8r$ docker \
    run \
    -i \
    --mount=type=bind,source=/tmp/ge_y_z8r,target=/yGBzWi \
    --mount=type=bind,source=/tmp/pp14dn6j,target=/tmp \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline/examples/run_all_config_docker.yaml,target=/var/lib/cwl/stgb1d833cd-18da-4002-a191-668ba6669671/run_all_config_docker.yaml,readonly \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_prep,target=/var/lib/cwl/stg03004a01-f7f3-47d6-9ac6-aa88b5c6f560/Berlin_prep,readonly \
    --workdir=/yGBzWi \
    --read-only=true \
    --net=none \
    --user=1001:1001 \
    --rm \
    --cidfile=/tmp/ujwhpfrj/20261127104934-419374.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/yGBzWi \
    ghcr.io/esa-heatwise/heatwise-hsi-lst-prep:1.0.0 \
    python \
    /app/processor.py \
    run-all \
    --config \
    /var/lib/cwl/stgb1d833cd-18da-4002-a191-668ba6669671/run_all_config_docker.yaml \
    --input-catalog \
    /var/lib/cwl/stg03004a01-f7f3-47d6-9ac6-aa88b5c6f560/Berlin_prep/catalog.json \
    --output-dir \
    .
[run-all] Loaded 1 city/cities from STAC catalog: /var/lib/cwl/stg03004a01-f7f3-47d6-9ac6-aa88b5c6f560/Berlin_prep/catalog.json
[band_trim] Saved 01_trimmed/Berlin_trimmed.tif (124 bands kept)
Target resolution: 10 m | Regression method: linear

=== Berlin_trimmed.tif  <-  Berlin_S2.tif ===
  Resampling Sentinel-2 -> 10m nested grid (810x537) ...
  S2 gap pixels inside footprint: 545 -> nearest-neighbor fill
  Training pixels: 48311 / 48330
  Fitting and predicting (method=linear) ...
  Saved: 02_sharpened_10m/Berlin_trimmed_sharp10m.tif  (124 bands, 810x537, 10m)

All done. Results in: 02_sharpened_10m

Processing Berlin
  Bands: 124, valid pixels: 48311
  Selected bands (0-based, 55): [2, 7, 9, 10, 13, 15, 17, 20, 24, 28, 29, 30, 31, 32, 33, 34, 35, 37, 41, 52, 63, 67, 69, 70, 71, 72, 74, 80, 85, 89, 91, 94, 96, 98, 99, 100, 101, 102, 104, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122]

Voting result (0-based): [2, 7, 9, 10, 13, 15, 17, 20, 24, 28, 29, 30, 31, 32, 33, 34, 35, 37, 41, 52, 63, 67, 69, 70, 71, 72, 74, 80, 85, 89, 91, 94, 96, 98, 99, 100, 101, 102, 104, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122]

Final 30 bands (0-based): [2, 7, 13, 17, 20, 24, 28, 32, 37, 41, 52, 63, 67, 71, 74, 80, 85, 89, 94, 98, 102, 104, 107, 109, 111, 113, 115, 117, 119, 121]

Saved selection to band_selection.json
Loaded 30 selected bands from json: [3, 8, 14, 18, 21, 25, 29, 33, 38, 42, 53, 64, 68, 72, 75, 81, 86, 90, 95, 99, 103, 105, 108, 110, 112, 114, 116, 118, 120, 122]
[apply_band_selection] Saved 03_hsi_final/hsi_bs/Berlin_hsi_bs.tif (30 bands)
[lst] Source: 7 bands, (50.0, 50.0), EPSG:32633, nodata=nan
[lst] Resampled onto reference grid 810x537; valid fraction 98.6%
[lst] Normalized (zscore): min/med/max = -4.463/0.019/3.318
[lst] Saved: 04_lst_final/Berlin_lst_final.tif  (+ 04_lst_final/Berlin_lst_final.json)
[stac_io] Wrote output catalogue: catalog.json (1 item(s))

[run-all] All done. Output directory: .
INFO [job prep] Max memory used: 1438MiB
INFO [job prep] completed success
INFO [step prep] completed success
INFO [workflow ] starting step extract_patches
INFO [step extract_patches] start
INFO [job extract_patches] /tmp/_50d15ji$ docker \
    run \
    -i \
    --mount=type=bind,source=/tmp/_50d15ji,target=/yGBzWi \
    --mount=type=bind,source=/tmp/y9fzie7d,target=/tmp \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_labels,target=/var/lib/cwl/stg5a5409fd-1211-4c77-9917-a20e19746271/Berlin_labels,readonly \
    --mount=type=bind,source=/tmp/ge_y_z8r,target=/var/lib/cwl/stgc8d54820-a3b7-4f89-b40f-a652f4ebea99/ge_y_z8r,readonly \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_prep/Berlin_S2.tif,target=/var/lib/cwl/stg6d6d7acf-6dff-49cf-8706-f03e12c800af/Berlin_S2.tif,readonly \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline/examples/patch_config_template.yaml,target=/var/lib/cwl/stg60eecab1-a355-4e7e-9688-9cec8a7c9247/patch_config_template.yaml,readonly \
    --workdir=/yGBzWi \
    --read-only=true \
    --net=none \
    --user=1001:1001 \
    --rm \
    --cidfile=/tmp/7w4qa36z/20261127104959-252926.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/yGBzWi \
    ghcr.io/esa-heatwise/heatwise-patch-extraction-pipeline:1.0.0 \
    python \
    /app/run_patch_extraction.py \
    --labels-basename \
    Berlin_labels \
    --labels-dir \
    /var/lib/cwl/stg5a5409fd-1211-4c77-9917-a20e19746271/Berlin_labels \
    --output-h5 \
    patches.h5 \
    --prep-dir \
    /var/lib/cwl/stgc8d54820-a3b7-4f89-b40f-a652f4ebea99/ge_y_z8r \
    --sentinel2 \
    /var/lib/cwl/stg6d6d7acf-6dff-49cf-8706-f03e12c800af/Berlin_S2.tif \
    --template \
    /var/lib/cwl/stg60eecab1-a355-4e7e-9688-9cec8a7c9247/patch_config_template.yaml
[labels] Using existing Shapefile: /var/lib/cwl/stg5a5409fd-1211-4c77-9917-a20e19746271/Berlin_labels/Berlin_labels.shp
[labels] Polygons: 17 -> 15 after area filtering
[labels] Class distribution:
 Name
2     4
6     3
11    2
5     2
14    1
17    1
8     1
12    1
Name: count, dtype: int64
[processor] city=Berlin  bands  sen2=10  hsi=30  lst=on
[processor] Sample points: 719
[processor] Filtered: out_of_bounds=19 low_overlap=211 empty=0 unmapped=0
[processor] Valid candidate patches: 489
[geo_split] Super-blocks: 61 (edge 600.0 m) | geo-isolatable classes: [2, 5, 6, 11]
[geo_split] Classes falling back to random split (too few super-blocks): [(8, 2), (12, 2), (14, 1), (17, 2)]
[geo_split] Searched 20 seeds -> chose seed=12 (zero-coverage cells=3, min cell=0)
[geo_split] Patches dropped at split boundaries for geo-isolated classes: 243 (49.7%)
[processor] Kept patches: 246 / 489

[processor] Patch count per split x class:
  class 2: train=34 val=33 test=21
  class 5: train=9 val=0 test=13
  class 6: train=42 val=19 test=7
  class 8: train=17 val=6 test=6
  class 11: train=12 val=0 test=4
  class 12: train=9 val=3 test=3
  class 14: train=1 val=0 test=1
  class 17: train=4 val=1 test=1
[patch_io] Saved: patches.h5  sen2(246, 32, 32, 10)  hsi_bs(246, 32, 32, 30)  lst(246, 32, 32, 1)
[processor] Output H5: patches.h5
[processor] Output STAC catalog: /yGBzWi/catalog.json
[run_patch_extraction] hsi=/var/lib/cwl/stgc8d54820-a3b7-4f89-b40f-a652f4ebea99/ge_y_z8r/03_hsi_final/hsi_bs/Berlin_hsi_bs.tif
[run_patch_extraction] sentinel2=/var/lib/cwl/stg6d6d7acf-6dff-49cf-8706-f03e12c800af/Berlin_S2.tif
[run_patch_extraction] lst=/var/lib/cwl/stgc8d54820-a3b7-4f89-b40f-a652f4ebea99/ge_y_z8r/04_lst_final/Berlin_lst_final.tif
[run_patch_extraction] Adapter STAC=/tmp/patch_input_catalog/catalog.json
[run_patch_extraction] labels.shp=/var/lib/cwl/stg5a5409fd-1211-4c77-9917-a20e19746271/Berlin_labels/Berlin_labels.shp
[run_patch_extraction] Rendered config -> /tmp/patch_config_rendered.yaml
[run_patch_extraction] Running: python /app/processor.py --config /tmp/patch_config_rendered.yaml --input-catalog /tmp/patch_input_catalog/catalog.json --output-h5 patches.h5
INFO [job extract_patches] Max memory used: 319MiB
INFO [job extract_patches] completed success
INFO [step extract_patches] completed success
INFO [workflow ] starting step train
INFO [step train] start
INFO [job train] /tmp/w5ttwb20$ docker \
    run \
    -i \
    --mount=type=bind,source=/tmp/w5ttwb20,target=/yGBzWi \
    --mount=type=bind,source=/tmp/1n7rrvt7,target=/tmp \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline/examples/train_config_sample.yaml,target=/var/lib/cwl/stgf151530d-d1ff-4a64-ad8a-ef0e3ad39043/train_config_sample.yaml,readonly \
    --mount=type=bind,source=/tmp/_50d15ji,target=/var/lib/cwl/stg79cd78a0-ac88-4df0-9df7-f15ff24a75c2/_50d15ji,readonly \
    --workdir=/yGBzWi \
    --read-only=true \
    --net=none \
    --user=1001:1001 \
    --rm \
    --cidfile=/tmp/dg7dqpwg/20261127105002-710788.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/yGBzWi \
    ghcr.io/esa-heatwise/heatwise-lcz-classification:1.0.0 \
    python \
    /app/processor.py \
    train \
    --config \
    /var/lib/cwl/stgf151530d-d1ff-4a64-ad8a-ef0e3ad39043/train_config_sample.yaml \
    --input-catalog \
    /var/lib/cwl/stg79cd78a0-ac88-4df0-9df7-f15ff24a75c2/_50d15ji/catalog.json \
    --output-dir \
    .
/usr/local/lib/python3.11/site-packages/torch/nn/modules/conv.py:196: UserWarning: Initializing zero-element tensors is a no-op
  init.kaiming_uniform_(self.weight, a=math.sqrt(5))
Device: cpu
  patches.h5: N=246  sen2(32, 32, 10)  hsi_bs(32, 32, 30)  hsi_pca<MISSING>  lst(32, 32, 1)

Merged 1 H5 files -> N=246 | sen2(32, 32, 10)  hsi_bs(32, 32, 30)  hsi_pca<MISSING>  lst(32, 32, 1)
Class distribution: {np.int64(1): np.int64(88), np.int64(4): np.int64(22), np.int64(5): np.int64(68), np.int64(7): np.int64(29), np.int64(10): np.int64(16), np.int64(11): np.int64(15), np.int64(13): np.int64(2), np.int64(16): np.int64(6)}
Split: using predefined spatial/group split from H5 dataset 'split'
LST used as-is (already normalized in the H5)
Split sizes: train=128  val=62  test=56

==== Running HSI-BS  (hsi=hsi_bs, sen2=False, lst=False) ====
[001/50] Train Loss: 2.2189, Train Acc: 48.44% | Val Loss: 2.3292, Val Acc: 53.23%
[002/50] Train Loss: 1.5587, Train Acc: 72.66% | Val Loss: 1.9317, Val Acc: 53.23%
[003/50] Train Loss: 1.3146, Train Acc: 72.66% | Val Loss: 1.5406, Val Acc: 53.23%
[004/50] Train Loss: 1.1821, Train Acc: 82.03% | Val Loss: 1.1715, Val Acc: 59.68%
[005/50] Train Loss: 1.0693, Train Acc: 81.25% | Val Loss: 0.5824, Val Acc: 95.16%
[006/50] Train Loss: 1.1026, Train Acc: 78.91% | Val Loss: 0.5202, Val Acc: 100.00%
[007/50] Train Loss: 0.8988, Train Acc: 88.28% | Val Loss: 0.4918, Val Acc: 100.00%
[008/50] Train Loss: 0.8877, Train Acc: 89.84% | Val Loss: 0.4742, Val Acc: 100.00%
[009/50] Train Loss: 0.8183, Train Acc: 89.06% | Val Loss: 0.5395, Val Acc: 93.55%
[010/50] Train Loss: 0.7705, Train Acc: 94.53% | Val Loss: 0.3246, Val Acc: 100.00%
[011/50] Train Loss: 0.7362, Train Acc: 92.97% | Val Loss: 0.2706, Val Acc: 100.00%
[012/50] Train Loss: 0.7219, Train Acc: 92.97% | Val Loss: 0.3440, Val Acc: 100.00%
[013/50] Train Loss: 0.7140, Train Acc: 96.88% | Val Loss: 0.2926, Val Acc: 96.77%
[014/50] Train Loss: 0.6660, Train Acc: 96.09% | Val Loss: 0.3772, Val Acc: 100.00%
[015/50] Train Loss: 0.6130, Train Acc: 99.22% | Val Loss: 0.2775, Val Acc: 100.00%
[016/50] Train Loss: 0.6468, Train Acc: 96.88% | Val Loss: 0.2664, Val Acc: 100.00%
[017/50] Train Loss: 0.5707, Train Acc: 98.44% | Val Loss: 0.2155, Val Acc: 100.00%
[018/50] Train Loss: 0.5882, Train Acc: 98.44% | Val Loss: 0.2961, Val Acc: 100.00%
[019/50] Train Loss: 0.5242, Train Acc: 98.44% | Val Loss: 0.3293, Val Acc: 100.00%
[020/50] Train Loss: 0.5259, Train Acc: 98.44% | Val Loss: 0.2729, Val Acc: 100.00%
[021/50] Train Loss: 0.5351, Train Acc: 97.66% | Val Loss: 0.1694, Val Acc: 100.00%
[022/50] Train Loss: 0.5372, Train Acc: 98.44% | Val Loss: 0.2685, Val Acc: 100.00%
[023/50] Train Loss: 0.4948, Train Acc: 98.44% | Val Loss: 0.2983, Val Acc: 100.00%
[024/50] Train Loss: 0.5217, Train Acc: 96.88% | Val Loss: 0.2592, Val Acc: 100.00%
[025/50] Train Loss: 0.5120, Train Acc: 99.22% | Val Loss: 0.3247, Val Acc: 100.00%
[026/50] Train Loss: 0.4884, Train Acc: 98.44% | Val Loss: 0.3086, Val Acc: 100.00%
[027/50] Train Loss: 0.4582, Train Acc: 100.00% | Val Loss: 0.2709, Val Acc: 100.00%
[028/50] Train Loss: 0.5079, Train Acc: 97.66% | Val Loss: 0.3071, Val Acc: 100.00%
[029/50] Train Loss: 0.4868, Train Acc: 98.44% | Val Loss: 0.2420, Val Acc: 100.00%
[030/50] Train Loss: 0.4805, Train Acc: 98.44% | Val Loss: 0.1983, Val Acc: 100.00%
[031/50] Train Loss: 0.4443, Train Acc: 99.22% | Val Loss: 0.2324, Val Acc: 100.00%
Early stopping at epoch 31

HSI-BS Results:
  OA    = 0.7143
  Kappa = 0.6070
  Macro recall = 71.43%

==== Summary ====
  mode       OA    Kappa  MacroRecall
HSI-BS 0.714286 0.607018     0.714286
[processor] Training input: /var/lib/cwl/stg79cd78a0-ac88-4df0-9df7-f15ff24a75c2/_50d15ji/patches.h5
[processor] Output STAC catalog: /yGBzWi/catalog.json
INFO [job train] Max memory used: 1438MiB
INFO [job train] completed success
INFO [step train] completed success
INFO [workflow ] starting step predict
INFO [step predict] start
INFO [job predict] /tmp/u8czh4ti$ docker \
    run \
    -i \
    --mount=type=bind,source=/tmp/u8czh4ti,target=/yGBzWi \
    --mount=type=bind,source=/tmp/dea698yn,target=/tmp \
    --mount=type=bind,source=/tmp/ge_y_z8r,target=/var/lib/cwl/stg7ac8d088-38f6-4972-9acf-4a14df8ef81e/ge_y_z8r,readonly \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_prep/Berlin_S2.tif,target=/var/lib/cwl/stga82c77f2-2767-4b49-b78c-3f93441163bf/Berlin_S2.tif,readonly \
    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-lcz-pipeline/examples/predict_config_template.yaml,target=/var/lib/cwl/stga5642bac-da74-4bda-b2f1-a13d26407185/predict_config_template.yaml,readonly \
    --mount=type=bind,source=/tmp/w5ttwb20,target=/var/lib/cwl/stga9a9b35c-3cc5-4a9c-9ae3-1095f24e5a9e/w5ttwb20,readonly \
    --workdir=/yGBzWi \
    --read-only=true \
    --net=none \
    --user=1001:1001 \
    --rm \
    --cidfile=/tmp/sb8stvda/20261127105334-126668.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/yGBzWi \
    ghcr.io/esa-heatwise/heatwise-lcz-classification-pipeline:1.0.0 \
    python \
    /app/run_predict.py \
    --experiment-name \
    HSI-BS \
    --output-dir \
    . \
    --prep-dir \
    /var/lib/cwl/stg7ac8d088-38f6-4972-9acf-4a14df8ef81e/ge_y_z8r \
    --sentinel2 \
    /var/lib/cwl/stga82c77f2-2767-4b49-b78c-3f93441163bf/Berlin_S2.tif \
    --template \
    /var/lib/cwl/stga5642bac-da74-4bda-b2f1-a13d26407185/predict_config_template.yaml \
    --train-dir \
    /var/lib/cwl/stga9a9b35c-3cc5-4a9c-9ae3-1095f24e5a9e/w5ttwb20
/usr/local/lib/python3.11/site-packages/torch/nn/modules/conv.py:196: UserWarning: Initializing zero-element tensors is a no-op
  init.kaiming_uniform_(self.weight, a=math.sqrt(5))
[predict_map] modal=hsi  use_lst=False  device=cpu
[predict_map] Image 810x537, stacked channels=30, valid pixels=434858
[predict_map] Windows to predict: 1564
  progress 32/1564

[predict_map] Saved LCZ map: /yGBzWi/lcz_map.tif
Per-class pixel counts: {2: 214016, 5: 11776, 6: 122880, 8: 15616, 11: 10240, 12: 19200, 17: 6656}
[predict_map] Saved color preview: /yGBzWi/lcz_map_preview.png
[processor] Output LCZ map: /yGBzWi/lcz_map.tif
[processor] Output STAC catalog: /yGBzWi/catalog.json
[run_predict] hsi=/var/lib/cwl/stg7ac8d088-38f6-4972-9acf-4a14df8ef81e/ge_y_z8r/03_hsi_final/hsi_bs/Berlin_hsi_bs.tif
[run_predict] sentinel2=/var/lib/cwl/stga82c77f2-2767-4b49-b78c-3f93441163bf/Berlin_S2.tif
[run_predict] lst=/var/lib/cwl/stg7ac8d088-38f6-4972-9acf-4a14df8ef81e/ge_y_z8r/04_lst_final/Berlin_lst_final.tif
[run_predict] Adapter STAC=/tmp/predict_input_catalog/catalog.json
[run_predict] weights=/var/lib/cwl/stga9a9b35c-3cc5-4a9c-9ae3-1095f24e5a9e/w5ttwb20/best_model_HSI-BS.pth
[run_predict] output=/yGBzWi/lcz_map.tif
[run_predict] Running: python /app/processor.py predict --config /var/lib/cwl/stga5642bac-da74-4bda-b2f1-a13d26407185/predict_config_template.yaml --input-catalog /tmp/predict_input_catalog/catalog.json --weights /var/lib/cwl/stga9a9b35c-3cc5-4a9c-9ae3-1095f24e5a9e/w5ttwb20/best_model_HSI-BS.pth --output /yGBzWi/lcz_map.tif
INFO [job predict] Max memory used: 1438MiB
INFO [job predict] completed success
INFO [step predict] completed success
INFO [workflow ] completed success
{
    "prep_output": {
        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r",
        "basename": "ge_y_z8r",
        "class": "Directory",
        "listing": [
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/01_trimmed",
                "basename": "01_trimmed",
                "listing": [
                    {
                        "class": "File",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/01_trimmed/Berlin_trimmed.tif",
                        "basename": "Berlin_trimmed.tif",
                        "size": 26786504,
                        "checksum": "sha1$2e6fd2fffee196fd159536d8214fe7573fd9dc83",
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/01_trimmed/Berlin_trimmed.tif"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/01_trimmed"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final",
                "basename": "03_hsi_final",
                "listing": [
                    {
                        "class": "Directory",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final/hsi_bs",
                        "basename": "hsi_bs",
                        "listing": [
                            {
                                "class": "File",
                                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final/hsi_bs/Berlin_hsi_bs.tif",
                                "basename": "Berlin_hsi_bs.tif",
                                "size": 46153035,
                                "checksum": "sha1$5155ac43041e82013559c0eb340e536ec32a1e8b",
                                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final/hsi_bs/Berlin_hsi_bs.tif"
                            }
                        ],
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final/hsi_bs"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/03_hsi_final"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/catalog.json",
                "basename": "catalog.json",
                "size": 271,
                "checksum": "sha1$75230bdbf7fa5903db2b3539ecbc5c1af368f044",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/catalog.json"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final",
                "basename": "04_lst_final",
                "listing": [
                    {
                        "class": "File",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final/Berlin_lst_final.tif",
                        "basename": "Berlin_lst_final.tif",
                        "size": 1433802,
                        "checksum": "sha1$144ebb58ee953d37e53c29fd2364ab2c725ed76b",
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final/Berlin_lst_final.tif"
                    },
                    {
                        "class": "File",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final/Berlin_lst_final.json",
                        "basename": "Berlin_lst_final.json",
                        "size": 284,
                        "checksum": "sha1$0f51880e47975533fad46cb716f85f580824a1ed",
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final/Berlin_lst_final.json"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/04_lst_final"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/02_sharpened_10m",
                "basename": "02_sharpened_10m",
                "listing": [
                    {
                        "class": "File",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/02_sharpened_10m/Berlin_trimmed_sharp10m.tif",
                        "basename": "Berlin_trimmed_sharp10m.tif",
                        "size": 188281066,
                        "checksum": "sha1$f82ae4b6507bff32015997b3d359c49e68b3b4d7",
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/02_sharpened_10m/Berlin_trimmed_sharp10m.tif"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/02_sharpened_10m"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/Berlin_item.json",
                "basename": "Berlin_item.json",
                "size": 1629,
                "checksum": "sha1$a0ef925849cd9dbb7552b9bc6555b605ec9d0ac1",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/Berlin_item.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/band_selection.json",
                "basename": "band_selection.json",
                "size": 2344,
                "checksum": "sha1$db237edbfa2a67b0b28810bb23218c4bfd07d9eb",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r/band_selection.json"
            }
        ],
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/ge_y_z8r"
    },
    "patch_output": {
        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji",
        "basename": "_50d15ji",
        "class": "Directory",
        "listing": [
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/Berlin-patches_item.json",
                "basename": "Berlin-patches_item.json",
                "size": 45429,
                "checksum": "sha1$ac8f5963ba385b1b78295d0effe6395f374c14e1",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/Berlin-patches_item.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/catalog.json",
                "basename": "catalog.json",
                "size": 302,
                "checksum": "sha1$c58fa347fff13ba8ad7101f9c377bdec2776916d",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/catalog.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/patches.h5",
                "basename": "patches.h5",
                "size": 41341850,
                "checksum": "sha1$d22302f7c2eb8e8062c62b7cbf7a69fa6e4ec754",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji/patches.h5"
            }
        ],
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/_50d15ji"
    },
    "train_output": {
        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20",
        "basename": "w5ttwb20",
        "class": "Directory",
        "listing": [
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.csv",
                "basename": "confusion_matrix_HSI-BS.csv",
                "size": 833,
                "checksum": "sha1$85d340b09301c7a5b6703bff7398b1c7c0e8b30c",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.csv"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.npy",
                "basename": "confusion_matrix_HSI-BS.npy",
                "size": 2440,
                "checksum": "sha1$0309673aef1946234d266d9ee53e95cb008817d8",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.npy"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache",
                "basename": ".cache",
                "listing": [
                    {
                        "class": "Directory",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache/matplotlib",
                        "basename": "matplotlib",
                        "listing": [
                            {
                                "class": "File",
                                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache/matplotlib/fontlist-v3.11.0.json",
                                "basename": "fontlist-v3.11.0.json",
                                "size": 29302,
                                "checksum": "sha1$ad4c67cf894ea29e45d4e6fbfebc8d7d4dced9c8",
                                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache/matplotlib/fontlist-v3.11.0.json"
                            }
                        ],
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache/matplotlib"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.cache"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/catalog.json",
                "basename": "catalog.json",
                "size": 307,
                "checksum": "sha1$bcd8917e94e3f33ac51e69ba9755b9dbbf034d69",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/catalog.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/training_artifacts_item.json",
                "basename": "training_artifacts_item.json",
                "size": 46557,
                "checksum": "sha1$9a98480bf57e0a0dbf545c76d2a43e9dc5ccdbd5",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/training_artifacts_item.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/best_model_HSI-BS.pth",
                "basename": "best_model_HSI-BS.pth",
                "size": 1100475,
                "checksum": "sha1$82e41c51cda9999926674f7f1f3715e1ef205df8",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/best_model_HSI-BS.pth"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/per_class_accuracy_HSI-BS.csv",
                "basename": "per_class_accuracy_HSI-BS.csv",
                "size": 239,
                "checksum": "sha1$3a1ec68c2d5987f52a3d7487a75b83849760d08d",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/per_class_accuracy_HSI-BS.csv"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.config",
                "basename": ".config",
                "listing": [
                    {
                        "class": "Directory",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.config/matplotlib",
                        "basename": "matplotlib",
                        "listing": [],
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.config/matplotlib"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/.config"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.png",
                "basename": "confusion_matrix_HSI-BS.png",
                "size": 425708,
                "checksum": "sha1$aa562c2823be4592a652b1ddc499b2694884b2b7",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/confusion_matrix_HSI-BS.png"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/summary.csv",
                "basename": "summary.csv",
                "size": 90,
                "checksum": "sha1$5ba0a3dce33d1e3eec572b43ef1e60cf35c120ca",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20/summary.csv"
            }
        ],
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/w5ttwb20"
    },
    "output": {
        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti",
        "basename": "u8czh4ti",
        "class": "Directory",
        "listing": [
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_map.tif",
                "basename": "lcz_map.tif",
                "size": 6426,
                "checksum": "sha1$ad3c13918e617f3f54be14ba27f93fb9cd633380",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_map.tif"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_map_preview.png",
                "basename": "lcz_map_preview.png",
                "size": 29771,
                "checksum": "sha1$eefa6110a42a73d9ee3c4d5b79b209d8b44f01b9",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_map_preview.png"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache",
                "basename": ".cache",
                "listing": [
                    {
                        "class": "Directory",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache/matplotlib",
                        "basename": "matplotlib",
                        "listing": [
                            {
                                "class": "File",
                                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache/matplotlib/fontlist-v3.11.0.json",
                                "basename": "fontlist-v3.11.0.json",
                                "size": 29302,
                                "checksum": "sha1$5285e08f78b8daa69e92c1441e83cb699220ec5b",
                                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache/matplotlib/fontlist-v3.11.0.json"
                            }
                        ],
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache/matplotlib"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.cache"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/catalog.json",
                "basename": "catalog.json",
                "size": 304,
                "checksum": "sha1$5b0fcd979b72e74d00adbd25d80c63410e81df1b",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/catalog.json"
            },
            {
                "class": "File",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_prediction_item.json",
                "basename": "lcz_prediction_item.json",
                "size": 1371,
                "checksum": "sha1$3958ff06535b25e6e459c9e6a5444f78b260d459",
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_prediction_item.json"
            },
            {
                "class": "Directory",
                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.config",
                "basename": ".config",
                "listing": [
                    {
                        "class": "Directory",
                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.config/matplotlib",
                        "basename": "matplotlib",
                        "listing": [],
                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.config/matplotlib"
                    }
                ],
                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/.config"
            }
        ],
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti"
    }
}INFO Final process status is success

Cwltool creates a new output directory with a random name when it is run. We save the last run in a variable to access it later.

CWLRUN_PATH=$(find-newest-directory-entry.sh "$OUTPUT_PATH/cwlruns")
echo "Path to last cwl run: $CWLRUN_PATH"
Path to last cwl run: /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti

12.3.2.1 Requirements Validated

req/app-pck/cwl (Requirement 7)

The Application Package SHALL be a valid CWL document with a “Workflow” class and one or more “CommandLineTool” classes.

12.3.2.2 EOAP Output

tree -n $CWLRUN_PATH || :
/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti
├── catalog.json
├── lcz_map.tif
├── lcz_map_preview.png
└── lcz_prediction_item.json

1 directory, 4 files

The EOAP produces a colour preview of the LCZ classification map, referenced as asset preview in its output STAC item:

python -c "import json, pathlib, shutil; \
    item_path = pathlib.Path(\"$CWLRUN_PATH/lcz_prediction_item.json\"); \
    preview = json.loads(item_path.read_text())['assets']['preview']['href']; \
    shutil.copy(item_path.parent / preview, 'lcz_pipeline_map.png')" || :

LCZ classification map

12.4 STAC input / output

12.4.1 Inputs

The EO Products of the input are provided as directories with a catalog.json describing the products each:

ls -lAhX --color=never $INPUT_PATH/*
/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_labels:
total 20K
-rw-r--r-- 1 runner runner   10 Nov 27 10:37 Berlin_labels.cpg
-rw-r--r-- 1 runner runner 1.5K Nov 27 10:37 Berlin_labels.dbf
-rw-r--r-- 1 runner runner  401 Nov 27 10:37 Berlin_labels.prj
-rw-r--r-- 1 runner runner 2.9K Nov 27 10:37 Berlin_labels.shp
-rw-r--r-- 1 runner runner  236 Nov 27 10:37 Berlin_labels.shx

/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/lcz-pipeline/Berlin_prep:
total 54M
-rw-r--r-- 1 runner runner    1 Nov 27 10:37 .gitkeep
-rw-r--r-- 1 runner runner 1.1K Nov 27 10:37 Berlin_item.json
-rw-r--r-- 1 runner runner  320 Nov 27 10:37 catalog.json
-rw-r--r-- 1 runner runner  44M Nov 27 10:37 Berlin_CHIME.tif
-rw-r--r-- 1 runner runner 503K Nov 27 10:37 Berlin_LSTM.tif
-rw-r--r-- 1 runner runner 9.9M Nov 27 10:37 Berlin_S2.tif

These same inputs are classed as Directory in the workflow:

extract-directory-inputs-from.sh Workflow "$CWL_PATH" || FAIL_REQ_4=1
Running
inputs_with_directory_type:
  - id: '#main/prep_input_catalog'
    type: Directory
    label: preprocessing input STAC catalog
    doc: 'Directory containing catalog.json, STAC Items, and the staged EO

      products required by heatwise-hsi-lst-prep.

      '
  - id: '#main/labels_dir'
    type: Directory
    label: LCZ labels directory
    doc: 'Directory containing the LCZ label shapefile and its associated

      sidecar files.

      '

12.4.2 Outputs

The output contains a single catalog.json and item, describing the output. Using the recursive validation, both the catalog and item are confirmed to be valid STAC.

(stac-validator validate --recursive $CWLRUN_PATH/catalog.json | cat) || FAIL_REQ_5=1

Thanks for using STAC version 1.1.0!

[
    {
        "version": "1.1.0",
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/catalog.json",
        "schema": [
            "https://schemas.stacspec.org/v1.1.0/catalog-spec/json-schema/catalog.json"
        ],
        "valid_stac": true,
        "asset_type": "CATALOG",
        "validation_method": "recursive",
        "validator_engine": "jsonschema"
    },
    {
        "version": "1.1.0",
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/lcz-pipeline/cwlruns/u8czh4ti/lcz_prediction_item.json",
        "schema": [
            "https://stac-extensions.github.io/processing/v1.2.0/schema.json",
            "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json"
        ],
        "valid_stac": true,
        "asset_type": "ITEM",
        "validation_method": "recursive",
        "validator_engine": "jsonschema"
    }
]

-- Recursive Validation Summary:
  Stac objects passed: 2/2 (100.0%)

  Breakdown by type:
    Catalog: 1/1 (100.0%)
    Item: 1/1 (100.0%)

Validation completed in 490.55ms

The EOAP best practice mandates that the item contains at least geometry, bbox and datetime keys.

extract-output-keys-from-stac-item.sh $CWLRUN_PATH/lcz_prediction_item.json || FAIL_REQ_6=1
geometry:
  type: Polygon
  coordinates: '[...truncated...]'
bbox:
  - 13.255963533307378
  - 52.448078953513594
  - 13.33782034204588
  - 52.5220055613443
properties:
  datetime: null
  start_datetime: '2009-08-20T00:00:00Z'
  end_datetime: '2023-07-09T23:59:59Z'

Required keys present: true

12.4.3 Requirements Validated

req/app/stac-input (Requirement 4)

An Application input argument that requires staged EO product files SHALL be defined as an argument that points to a folder where a STAC Catalog, named catalog.json, contains a list of one or more STAC Items and associated STAC Assets referencing the files.

req/app/stac-out (Requirement 5)

An Application that creates EO product files to be stage-out SHALL generate a valid STAC Catalog, named catalog.json, and include the STAC Item(s) and corresponding STAC Assets pointing to the results of the processing.

rec/app/stac-out-metadata (Requirement 6)

The STAC Catalog created by the Application SHALL include metadata elements for each STAC Item with at least their spatial (geometry, box) and temporal (datetime) properties.

12.5 CWL

The fields id, baseCommand, inputs, requirements should be present in the CommandLineTool. One of the requirements should be DockerRequirement.

check-commandlinetool-fields.sh "$CWL_PATH" || FAIL_REQ_8=1
id: '#extract_patches_pipeline.cwl'
baseCommand: python
requirements:
  - dockerPull: ghcr.io/esa-heatwise/heatwise-patch-extraction-pipeline:1.0.0
    class: DockerRequirement
---
id: '#hsi_lst_prep.cwl'
baseCommand: python
requirements:
  - dockerPull: ghcr.io/esa-heatwise/heatwise-hsi-lst-prep:1.0.0
    class: DockerRequirement
  - class: InlineJavascriptRequirement
---
id: '#lcz_train.cwl'
baseCommand: python
requirements:
  - dockerPull: ghcr.io/esa-heatwise/heatwise-lcz-classification:1.0.0
    class: DockerRequirement
  - class: InlineJavascriptRequirement
---
id: '#predict_pipeline.cwl'
baseCommand: python
requirements:
  - dockerPull: ghcr.io/esa-heatwise/heatwise-lcz-classification-pipeline:1.0.0
    class: DockerRequirement
Required keys present: true

The fields id, label, and doc should be present in the Workflow.

check-workflow-fields.sh "$CWL_PATH" || FAIL_REQ_9=1
id: '#main'
label: HEATWISE LCZ Full Pipeline
doc: "EOAP-compatible end-to-end HEATWISE LCZ workflow.\n\nThe workflow chains the\
  \ HEATWISE processors for hyperspectral/LST\npreprocessing, geographically isolated\
  \ patch extraction, LCZ model\ntraining, and whole-scene LCZ prediction:\n\n   \
  \ heatwise-hsi-lst-prep\n            ↓\n    heatwise-patch-extraction\n        \
  \    ↓\n    heatwise-lcz-classification train\n            ↓\n    heatwise-lcz-classification\
  \ predict\n\nEO products are exchanged between processing stages through STAC-enabled\n\
  directories. Internal pipeline adapters are used only where interface\nadaptation\
  \ is required, such as adding the original Sentinel-2 product,\ninjecting dynamically\
  \ staged LCZ labels, or selecting a trained model\ncheckpoint.\n\nThe scientific\
  \ processing logic remains implemented by the upstream\nHEATWISE processor images.\n"
Required keys present: true

Each input of the Workflow should have fields id, label, and doc

check-workflow-input-fields.sh $CWL_PATH || FAIL_REQ_10=1
inputs:
  - id: 0
    label: preprocessing configuration
    doc: 'Run-level YAML configuration controlling the HSI/LST preprocessing

      stage.

      '
  - id: 1
    label: preprocessing input STAC catalog
    doc: 'Directory containing catalog.json, STAC Items, and the staged EO

      products required by heatwise-hsi-lst-prep.

      '
  - id: 2
    label: Sentinel-2 raster
    doc: 'Original Sentinel-2 raster. The preprocessing stage uses the copy

      referenced by the input STAC catalog, while this explicit File input

      is also supplied to the patch-extraction and prediction adapters.

      '
  - id: 3
    label: patch extraction configuration
    doc: 'Patch-extraction YAML configuration containing the scientific

      processing parameters. The dynamically staged labels.shp path is

      injected by the pipeline adapter.

      '
  - id: 4
    label: LCZ labels directory
    doc: 'Directory containing the LCZ label shapefile and its associated

      sidecar files.

      '
  - id: 5
    label: labels basename
    doc: 'Basename of the label shapefile without the .shp extension.

      '
  - id: 6
    label: LCZ training configuration
    doc: 'YAML configuration defining LCZ_HMSSNet training parameters and

      modality experiments.

      '
  - id: 7
    label: LCZ prediction configuration
    doc: 'Prediction YAML configuration containing inference and model

      parameters. EO raster paths and model weights are supplied separately

      by the pipeline adapter.

      '
  - id: 8
    label: experiment name
    doc: 'Name of the training experiment whose best_model_<experiment>.pth

      checkpoint is used for whole-scene prediction.

      '

The CWL document should contain a version:

check-version.sh $CWL_PATH || FAIL_REQ_11=1
s:version: null
https://schema.org/version: 1.0.0
Found version:  true

12.5.1 Requirements Validated

req/app-pck/clt (Requirement 8)

The Application Package CWL CommandLineTool classes SHALL contain the following elements:

  • Identifier (“id”)
  • Command line name (“baseCommand”)
  • Input parameters (“inputs”)
  • Environment requirements (“requirements”)
  • Docker information (“DockerRequirement”)

req/app-pck/wf (Requirement 9)

The Application Package CWL Workflow class SHALL contain the following elements:

  • Identifier (“id”)
  • Title (“label”)
  • Abstract (“doc”)

req/app-pck/wf-inputs (Requirement 10)

The Application Package CWL Workflow class “inputs” fields SHALL contain the following elements:

  • Identifier (“id”)
  • Title (“label”)
  • Abstract (“doc”)

req/app-pck/metadata (Requirement 11)

The Application Package CWL Workclass classes SHALL include additional metadata as defined in Table 1

Required in table 1: version

12.6 CWL STAC / IO

Inputs and outputs are staged in and out using STAC catalogs. Each input that is an “EO Product” like a vector or raster dataset is declared as type Directory and is described by a STAC catalog catalog.json and accompanying STAC item(s) placed in that directory.

Outputs are handled in much the same way, the application in the application package is responsible for generating a STAC catalog (also named catalog.json) and stage out all the contents of its working directory together with the STAC metadata describing the outputs.

12.6.1 Inputs

There are inputs of type directory in the CommandLineTool description.

extract-directory-inputs-from.sh CommandLineTool "$CWL_PATH" || FAIL_REQ_12=1
Running
inputs_with_directory_type:
  - type: Directory
    label: LCZ labels directory
    doc: 'Directory containing the label shapefile and its associated sidecar

      files (.shx, .dbf, .prj, .cpg).

      '
    inputBinding:
      prefix: --labels-dir
    id: '#extract_patches_pipeline.cwl/labels_dir'
  - type: Directory
    label: preprocessing output
    doc: 'Complete STAC-enabled output directory produced by

      heatwise-hsi-lst-prep. Its catalog.json is used to discover the

      hsi_bs and optional lst products.

      '
    inputBinding:
      prefix: --prep-dir
    id: '#extract_patches_pipeline.cwl/prep_dir'
---
inputs_with_directory_type:
  - type: Directory
    label: input STAC catalog
    doc: 'Directory containing catalog.json and the associated STAC Items and

      EO assets required by the preprocessing workflow.

      '
    inputBinding:
      prefix: --input-catalog
      valueFrom: $(self.path + "/catalog.json")
    id: '#hsi_lst_prep.cwl/input_catalog'
---
inputs_with_directory_type:
  - type: Directory
    label: input STAC catalog
    doc: 'Directory containing catalog.json and the associated STAC Item

      referencing the patch HDF5 training dataset through the `patch_h5`

      asset.

      '
    inputBinding:
      prefix: --input-catalog
      valueFrom: $(self.path + "/catalog.json")
    id: '#lcz_train.cwl/input_catalog'
---
inputs_with_directory_type:
  - type: Directory
    label: preprocessing output
    doc: 'Complete STAC-enabled output directory produced by

      heatwise-hsi-lst-prep. Its catalog.json is used to discover the

      hsi_bs and optional lst products.

      '
    inputBinding:
      prefix: --prep-dir
    id: '#predict_pipeline.cwl/prep_dir'
  - type: Directory
    label: training output
    doc: 'Complete output directory produced by LCZ training. The adapter

      locates best_model_<experiment>.pth within this directory.

      '
    inputBinding:
      prefix: --train-dir
    id: '#predict_pipeline.cwl/train_dir'

There are inputs of type directory in the Workflow description.

extract-directory-inputs-from.sh Workflow "$CWL_PATH" || FAIL_REQ_13=1
Running
inputs_with_directory_type:
  - id: '#main/prep_input_catalog'
    type: Directory
    label: preprocessing input STAC catalog
    doc: 'Directory containing catalog.json, STAC Items, and the staged EO

      products required by heatwise-hsi-lst-prep.

      '
  - id: '#main/labels_dir'
    type: Directory
    label: LCZ labels directory
    doc: 'Directory containing the LCZ label shapefile and its associated

      sidecar files.

      '

12.6.2 Outputs

The CommandLineTool stages out all the contents of the working directory.

extract-commandlinetool-outputs.sh "$CWL_PATH" || FAIL_REQ_14=1
- type: Directory
  doc: 'Complete working directory containing the HDF5 patch dataset and the

    STAC catalog generated by heatwise-patch-extraction.

    '
  outputBinding:
    glob: .
  id: '#extract_patches_pipeline.cwl/output'
---
- type: Directory
  doc: 'Complete preprocessing working directory, including the generated

    raster products, STAC Items, and catalog.json.

    '
  outputBinding:
    glob: .
  id: '#hsi_lst_prep.cwl/output'
---
- type: Directory
  doc: 'Complete training working directory containing model checkpoints,

    evaluation metrics, summary files, training artifacts, and the

    generated STAC catalog.

    '
  outputBinding:
    glob: .
  id: '#lcz_train.cwl/output'
---
- type: Directory
  doc: 'Complete working directory containing the LCZ classification GeoTIFF,

    optional preview PNG, and STAC catalog generated by the upstream

    prediction processor.

    '
  outputBinding:
    glob: .
  id: '#predict_pipeline.cwl/output'
Extracts all items from Working directory: true

12.6.3 Requirements validated

req/app-pck-stage-in/clt-stac (Requirement 12)

All input parameters of the CWL ComandLineTool that require the staging of EO products SHALL be of type Directory.

req/app-pck-stage-in/wf-stac (Requirement 13)

Input parameters of the CWL Workflow that require the staging of EO products SHALL be of type Directory.

req/app-pck-stage-out/output-stac (Requirement 14)

The outputs field of the CommandLineTool that requires the stage-out of EO products SHALL retrieve all the files produced in the working directory.

12.7 Summary

Requirement 1 is not tested (see below)

for i in {2..14}; do
    var="FAIL_REQ_$i"
    req=${var#FAIL_}
    if [[ "${!var:-}" == "1" ]]; then
        #echo "$req: FAILED"
        printf '%s\t\033[31mFAILED\033[0m\n' "$req"
    else
        printf '%s\t\033[32mPASSED\033[0m\n' "$req"
    fi
done
REQ_2  PASSED

REQ_3   PASSED

REQ_4   PASSED

REQ_5   PASSED

REQ_6   PASSED

REQ_7   PASSED

REQ_8   PASSED

REQ_9   PASSED

REQ_10  PASSED

REQ_11  PASSED

REQ_12  PASSED

REQ_13  PASSED

REQ_14  PASSED

The integrated pipeline of the Local Climate Zone classification software has been shown to be non-interactively executable using a CWL runner (cwltool). Furthermore it follows the CWL structure and mandatory fields prescribed by the OGC Best Practice for Earth Observation Application Package (EOAP). Inputs and outputs are processed as CWL Directories and valid STAC metadata is generated for the output. It may therefore be concluded that the software behaves as expected by the EOAP best practice in the example scenario.

The requirement /req/app/cmd-line (see Chapter 2) is skipped for the full pipeline. The EOAP best practice requires that the command-line software packaged as CWL CommandLineTools is non-interactively executable independently of the CWL wrapper. This is not considered in this demonstration chapter. However, the software making up the components of the full pipeline are demonstrated in sections Chapter 9, Chapter 10 and Chapter 11.

No conclusive judgment on the adherence to all requirements listed in Chapter 2 under all valid input conditions can be made without inspection of the source code. The demonstration evaluates the statically available information (the CWL document, and container image) as well as the outputs produced by a single example input dataset. It does not show how the validity and content of the generated output depends on the input dataset. While inputs are shown to be a directory containing STAC metadata, only inspection of the source code can establish whether the STAC is actually processed.

Furthermore, the demonstration purely evaluates the adherence of the software to the interoperability best practice and makes no attempt to judge the scientific validity of the data products produced.