openEO EODC backend deployment via TOSCA #6
Replies: 2 comments 2 replies
-
I report here the exampels I shared via email to test the deployed back-end:
import openeo
from openeo.metadata import CollectionMetadata
from openeo.processes import array_element
conn = openeo.connect('https://dev.openeo.eurac.edu').authenticate_basic("guest","changeme")
url = https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a
spatial_extent = {"east": 11.40, "north": 46.52, "south": 46.46, "west": 11.25}
temporal_extent = ["2022-06-01", "2022-06-30"]
bands = ["red", "nir"]
s2_datacube = conn.load_stac(
url=url,
spatial_extent=spatial_extent,
temporal_extent=temporal_extent,
bands=bands
)
s2_datacube.metadata = CollectionMetadata({"cube:dimensions":{"time":{"type":"temporal"},"band":{"type":"bands"}}})
def NDVI(data):
b04 = data.array_element(label="red")
b08 = data.array_element(label="nir")
return (b08 - b04) / (b08 + b04)
ndvi = s2_datacube.reduce_dimension(dimension="band",reducer=NDVI)
ndvi_median = ndvi.reduce_dimension(dimension="time", reducer="median")
result_ndvi = ndvi_median.download("ndvi_eurac.nc")
import openeo
import requests
from openeo.metadata import CollectionMetadata
from openeo.processes import array_element
s = requests.Session()
s.verify = False
conn = openeo.connect('https://openeo.62.217.83.68.nip.io/1.1.0/',session=s)
url = https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a
spatial_extent = {"east": 11.40, "north": 46.52, "south": 46.46, "west": 11.25}
temporal_extent = ["2022-06-01", "2022-06-30"]
bands = ["red", "nir"]
s2_datacube = conn.load_stac(
url=url,
spatial_extent=spatial_extent,
temporal_extent=temporal_extent,
bands=bands
)
s2_datacube.metadata = CollectionMetadata({"cube:dimensions":{"time":{"type":"temporal"},"band":{"type":"bands"}}})
def NDVI(data):
b04 = data.array_element(label="red")
b08 = data.array_element(label="nir")
return (b08 - b04) / (b08 + b04)
ndvi = s2_datacube.reduce_dimension(dimension="band",reducer=NDVI)
ndvi_median = ndvi.reduce_dimension(dimension="time", reducer="median")
result_ndvi = ndvi_median.download("ndvi_intertwin.nc")
It would be nice to have a working example using batch jobs and getting the result in STAC. @SerRichard where will the result be stored? Is there a linked object storage to this openEO back-end? @andrea-manzi I don't see Sean in the members, could you add him so that he can take part to the discussion? |
Beta Was this translation helpful? Give feedback.
-
If you change the line: conn = openeo.connect('https://openeo.62.217.83.68.nip.io/1.1.0/',session=s) With this, the authentication works (but I get another errors) token = "ey.........."
conn = openeo.connect('https://openeo.62.217.83.68.nip.io/1.1.0',session=s).authenticate_oidc_access_token(token) To get the value of the |
Beta Was this translation helpful? Give feedback.
-
Cluster deployed via IM at https://openeo.62.217.83.68.nip.io/1.1.0/
Need to clarify the EGI Check-in used. I have setup via IM to use the EGI Check-in demo instance, is that automatically configured ? or only the Production instance is there by default?
Beta Was this translation helpful? Give feedback.
All reactions