Convert search¶
Invoke a Common Workflow Language CommandLineTool bash script to invoke yq to:
- extract the discovered STAC Items
selflinkhrefthat is used as an input in the water bodies detection sub-workflow - extract the aoi bounding box from the
search_requestinput parameter
In [1]:
Copied!
from pathlib import Path
import sys
repo_root = next(
path for path in [Path.cwd(), *Path.cwd().parents]
if (path / "cwl-workflow/app-water-bodies.cwl").is_file()
)
sys.path.insert(0, str(repo_root / "docs"))
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
from pathlib import Path
import sys
repo_root = next(
path for path in [Path.cwd(), *Path.cwd().parents]
if (path / "cwl-workflow/app-water-bodies.cwl").is_file()
)
sys.path.insert(0, str(repo_root / "docs"))
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
Out[1]:
1
In [2]:
Copied!
wf = WorkflowViewer.from_file(
str(repo_root / "cwl-workflow/app-water-bodies.cwl"),
entrypoint="water-bodies",
)
wf = WorkflowViewer.from_file(
str(repo_root / "cwl-workflow/app-water-bodies.cwl"),
entrypoint="water-bodies",
)
Inputs¶
In [3]:
Copied!
wf.display_inputs(entrypoint="convert-search")
wf.display_inputs(entrypoint="convert-search")
| Id | Type | Label | Doc |
|---|---|---|---|
search_request |
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings |
Search Request | Search request from the discovery step |
search_results |
File |
Search Results | Search results from the discovery step |
Outputs¶
In [4]:
Copied!
wf.display_outputs(entrypoint="convert-search")
wf.display_outputs(entrypoint="convert-search")
| Id | Type | Label | Doc |
|---|---|---|---|
items |
Any |
Item self hrefs | Array of STAC Item self links extracted from search results |
aoi |
string |
AOI bbox CSV | Area of interest bbox serialized as CSV for downstream crop step |
Class diagram¶
In [5]:
Copied!
wf.display_class_diagram(entrypoint="convert-search")
wf.display_class_diagram(entrypoint="convert-search")
In [ ]:
Copied!