Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions force_level2_openeo_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import openeo

# url = "https://openeo.dataspace.copernicus.eu"
url = "https://openeo-staging.dataspace.copernicus.eu/"
url = "https://openeo.dataspace.copernicus.eu"
# url = "https://openeo-staging.dataspace.copernicus.eu/"
connection = openeo.connect(url).authenticate_oidc()

# datacube = connection.datacube_from_process(
Expand All @@ -15,6 +15,6 @@
stac_root="catalogue.json",
)

job = datacube.create_job()
job = datacube.create_job(title=__file__)
job.start_and_wait()
results = job.get_results()
4 changes: 2 additions & 2 deletions material/force-l2.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class: CommandLineTool
requirements:
DockerRequirement:
# dockerPull: registry.stag.warsaw.openeo.dataspace.copernicus.eu/rand/force-eoap:0.0.7
# dockerPull: quay.io/bcdev/force-eoap:0.0.7
dockerImageId: quay.io/bcdev/force-eoap:0.0.7
dockerPull: quay.io/bcdev/force-eoap:0.0.7
# dockerImageId: quay.io/bcdev/force-eoap:0.0.7
NetworkAccess:
networkAccess: true
baseCommand: /opt/apex-force-wrapper/bin/force-level2-wrapper.sh
Expand Down
2 changes: 1 addition & 1 deletion resources/output-item-boa-asset.template
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"eo:common_name": "swir22"
}
],
"type": "image/tif",
"type": "image/tiff",
"file:size": ${size},
"file:checksum": "$md5sum",
"file:local_path": "$boa_path",
Expand Down
2 changes: 1 addition & 1 deletion resources/output-item-ovv-asset.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"${id}": {
"href": "${ovv_path}",
"type": "image/jpg",
"type": "image/jpeg",
"file:size": ${size},
"file:checksum": "$md5sum",
"file:local_path": "$ovv_path",
Expand Down
2 changes: 1 addition & 1 deletion resources/output-item-qai-asset.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"${id}": {
"href": "${qai_path}",
"type": "image/tif",
"type": "image/tiff",
"file:size": ${size},
"file:checksum": "$md5sum",
"file:local_path": "$qai_path",
Expand Down
30 changes: 30 additions & 0 deletions run_load_stac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from pathlib import Path
import os
import openeo

stac_root = Path("l2-ard/catalogue.json").absolute()
if not stac_root.exists():
# Run the CWL first to create the stac catalog!
os.system(
"cwltool --preserve-environment=AWS_ENDPOINT_URL_S3 --preserve-environment=AWS_ACCESS_KEY_ID --preserve-environment=AWS_SECRET_ACCESS_KEY --force-docker-pull --leave-container --leave-tmpdir --tmpdir-prefix=$HOME/tmp/ material/force-l2.cwl"
)

from pystac import Catalog

validations = Catalog.from_file(str(stac_root)).validate_all()
assert validations > 0


datacube = openeo.DataCube.load_stac(
url=str(stac_root),
spatial_extent={"west": 10.25, "south": 44.13, "east": 11.67, "north": 45.15},
)

tmp_dir = Path(".").absolute() / "tmp"
tmp_dir.mkdir(exist_ok=True)

datacube.print_json(file=tmp_dir / "process_graph.json", indent=2)

from openeogeotrellis.deploy.run_graph_locally import run_graph_locally

run_graph_locally(tmp_dir / "process_graph.json", tmp_dir)