openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

Issue567 stac metadata temporal dim

Open clausmichele opened this issue 7 months ago • 3 comments

Very simple fix to https://github.com/Open-EO/openeo-python-client/issues/567, which allows doing:

from openeo.local import LocalConnection
local_conn = LocalConnection("./")

url = "https://stac.eurac.edu/collections/SENTINEL2_L2A_SAMPLE_2"
spatial_extent =  {"east": 11.40, "north": 46.52, "south": 46.46, "west": 11.25}
temporal_extent = ["2022-06-01", "2022-06-30"]
bands = ["B04"]
s2_cube = local_conn.load_stac(
    url=url,
    spatial_extent=spatial_extent,
    temporal_extent=temporal_extent,
    bands=bands,
)
s2_cube = s2_cube.reduce_dimension(dimension="time",reducer="mean")
s2_cube

which otherwise would end up with:

ValueError: Invalid dimension 'time'. Should be one of ['bands', 't']

clausmichele avatar Jul 17 '24 09:07 clausmichele