Pattern 12
Application Package Pattern 12¶
This patterns publishes all products generated by all steps
Inputs¶
| Id | Type | Label | Doc |
|---|---|---|---|
aoi |
https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#BBox |
area of interest | area of interest as a bounding box |
bands |
string[] |
bands used for the NDWI | bands used for the NDWI |
item |
Directory |
Landsat-8/9 acquisition reference | Landsat-8/9 acquisition reference |
cropped-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
cropped reflectances STAC Collection | STAC Collection URL for the cropped reflectances |
ndwi-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
NDWI STAC Collection | STAC Collection URL for the NDWI |
water-bodies-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
Water bodies STAC Collection | STAC Collection URL for the water bodies |
Steps¶
| Id | Runs | Label | Doc |
|---|---|---|---|
node_crop |
#crop |
Crop reflectances | Crop the reflectances from the Landsat-8/9 acquisition based on the area of interest and input bands |
node_normalized_difference |
#norm_diff |
Compute NDWI | Compute NDWI from the cropped reflectances |
node_otsu |
#otsu |
Detect water bodies | Detect water bodies based on the otsu threshold from the NDWI |
Outputs¶
| Id | Type | Label | Doc |
|---|---|---|---|
cropped |
Directory[] |
Cropped reflectances | Cropped reflectances |
ndwi |
Directory |
Normalized Difference Water Index | Normalized Difference Water Index calculated from the input bands |
water_bodies |
Directory |
Water bodies detected | Water bodies detected based on the NDWI and otsu threshold |
Data flow management¶
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[7], line 2 1 w = WorkflowWrapper(workflow=wf.workflow, entrypoint=entrypoint) ----> 2 wrapped = w.wrap() 3 4 app_cwl_file = f".{entrypoint}.cwl" 5 File ~/work/application-package-patterns/application-package-patterns/docs/helpers.py:120, in WorkflowWrapper.wrap(self) 113 file_stage_in = load_cwl_from_location( 114 path=f"{self.base_url}/templates/stage-in-file.cwl" 115 ) 116 stage_out_cwl = load_cwl_from_location( 117 path=f"{self.base_url}/templates/stage-out.cwl" 118 ) --> 120 return wrap( 121 directory_stage_in=directory_stage_in, 122 file_stage_in=file_stage_in, 123 workflows=self.workflow, 124 workflow_id=self.entrypoint, 125 stage_out=stage_out_cwl, 126 ) TypeError: wrap() got an unexpected keyword argument 'workflows'. Did you mean 'workflow'?
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[8], line 1 ----> 1 wf = WorkflowViewer(cwl_file=app_cwl_file, workflow=wrapped, entrypoint="main") 2 3 wf.display_state_diagram() NameError: name 'wrapped' is not defined
Workflow sequence diagram¶
Inputs¶
| Id | Type | Label | Doc |
|---|---|---|---|
aoi |
https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#BBox |
area of interest | area of interest as a bounding box |
bands |
string[] |
bands used for the NDWI | bands used for the NDWI |
item |
Directory |
Landsat-8/9 acquisition reference | Landsat-8/9 acquisition reference |
cropped-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
cropped reflectances STAC Collection | STAC Collection URL for the cropped reflectances |
ndwi-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
NDWI STAC Collection | STAC Collection URL for the NDWI |
water-bodies-collection |
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI |
Water bodies STAC Collection | STAC Collection URL for the water bodies |
Steps¶
| Id | Runs | Label | Doc |
|---|---|---|---|
node_crop |
#crop |
Crop reflectances | Crop the reflectances from the Landsat-8/9 acquisition based on the area of interest and input bands |
node_normalized_difference |
#norm_diff |
Compute NDWI | Compute NDWI from the cropped reflectances |
node_otsu |
#otsu |
Detect water bodies | Detect water bodies based on the otsu threshold from the NDWI |
Outputs¶
| Id | Type | Label | Doc |
|---|---|---|---|
cropped |
Directory[] |
Cropped reflectances | Cropped reflectances |
ndwi |
Directory |
Normalized Difference Water Index | Normalized Difference Water Index calculated from the input bands |
water_bodies |
Directory |
Water bodies detected | Water bodies detected based on the NDWI and otsu threshold |
Execution¶
Inputs¶
{
"aoi": {
"class": "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#BBox",
"bbox": [
-118.985,
38.432,
-118.183,
38.938
],
"crs": "CRS84"
},
"item": {
"class": "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#URI",
"value": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2/items/LC08_L2SP_042033_20231007_02_T1"
},
"bands": [
"green",
"nir08"
],
"cropped-collection": {
"class": "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#URI",
"value": "https://github.com/eoap/application-package-patterns/raw/refs/heads/develop/collections/cropped_collection.json"
},
"ndwi-collection": {
"class": "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#URI",
"value": "https://github.com/eoap/application-package-patterns/raw/refs/heads/develop/collections/ndi_collection.json"
},
"water-bodies-collection": {
"class": "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#URI",
"value": "https://github.com/eoap/application-package-patterns/raw/refs/heads/develop/collections/water_bodies_collection.json"
},
"another_input": "some_value",
"s3_bucket": "my-bucket",
"sub_path": "my/sub/path",
"aws_access_key_id": "test",
"aws_secret_access_key": "test",
"region_name": "us-west-1",
"endpoint_url": "https://s3.us-west-1.amazonaws.com"
}
Errors¶
CWL execution terminated with errors:
[1;30mINFO[0m /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/ipykernel_launcher.py 3.1.20260315121657
[1;30mINFO[0m Resolved '../cwl-workflow/pattern-12.cwl#main' to 'file:///home/runner/work/application-package-patterns/application-package-patterns/cwl-workflow/pattern-12.cwl#main'
[1;30mWARNING[0m [33m../cwl-workflow/pattern-12.cwl:90:7: Warning: checking item
Warning: Field 'class' contains undefined reference to
'http://oeap.github.io/schema#JSONSchemaHint'[0m
[1;30mERROR[0m [31mTool definition failed validation:
Reference '#main' not found in file 'file:///home/runner/work/application-package-patterns/application-package-patterns/cwl-workflow/pattern-12.cwl'.[0m