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

cannot specify instrument mode

Open atinaajeng opened this issue 10 months ago • 9 comments

This is a great API, but for for Sentinel-1 GRD, i only want to use imaging mode IW, but cannnot be specified here:(

atinaajeng avatar Mar 05 '25 21:03 atinaajeng

Hi,

can you be a bit more specific? For example: what openEO backend (URL) are you using? I'm also not sure this is an issue specifically for the openEO Python client, but more a back-end specific question. E.g. if you are using the openEO backend from the Copernicus Data Space Ecosystem, I would recommend to raise your question at the user forum https://forum.dataspace.copernicus.eu/c/openeo/28

soxofaan avatar Mar 06 '25 10:03 soxofaan

Hi,

I am using openeo.dataspace.copernicus.eu. I just realized that actually the imaging mode for Sentinel-1 over the study areas is only IW, so i guess this is no longer the problem. However, still i wish load_collection module can also specify the orbital pass (ascending/descending) and orbit number.

In the metadata, the imaging mode and orbital pass are exist, but i could not use it in load_collection module for filtering the image i am looking for. Or also maybe I did not know how to specify such information....

I hope this answers and thanks for the link!

atinaajeng avatar Mar 06 '25 15:03 atinaajeng

note that load_collection supports filtering on particular properties: see https://open-eo.github.io/openeo-python-client/data_access.html#filter-on-collection-properties

@Pratichhya @VincentVerelst @VictorVerhaert dou you have by any chance an example (community notebook) of using this for filtering on IW mode?

soxofaan avatar Mar 06 '25 16:03 soxofaan

We don't have an example for instrument mode filtering, however the simple example of filtering by properties is: https://github.com/eu-cdse/notebook-samples/blob/main/openeo/Radar_ARD.ipynb

So basically, for filtering based on instrument mode, the following example should work:

s1 = conn.load_collection( "SENTINEL1_GRD",
    spatial_extent=spatial_extent,
    bands=["VV", "VH"],
    temporal_extent=["2021-01-01", "2021-01-08"],
    properties={"sat:instrumentmode": lambda od: od == "IW"},
)

Pratichhya avatar Mar 07 '25 09:03 Pratichhya

since python client 0.26, it looks nicer, I guess, to use this pattern (avoiding the lambda), as mentioned at https://open-eo.github.io/openeo-python-client/data_access.html#filter-on-collection-properties:

import openeo
s1 = conn.load_collection( "SENTINEL1_GRD",
    ...,
    properties=[
        openeo.collection_property("sat:instrumentmode") == "IW",
    ],
)

I think we should promote that in example notebooks @Pratichhya

soxofaan avatar Mar 07 '25 10:03 soxofaan

@soxofaan @Pratichhya

Thank you very much for answering the question, is it indeed helpful. I tried the code and it works well. I should have explored more of course. One last question, how do i know the key let say, for example for instrument mode it is "sat:instrumentmode", orbit state it is "sat:orbit_state", and relative orbit number is "relativeOrbitNumber"? Well now i know, but just in case i will need more properties, i know which document I can then look up to...

atinaajeng avatar Mar 07 '25 11:03 atinaajeng

One last question, how do i know the key let say, for example for instrument mode it is "sat:instrumentmode", orbit state it is "sat:orbit_state", and relative orbit number is "relativeOrbitNumber"? Well now i know, but just in case i will need more properties, i know which document I can then look up to...

There is indeed still a usability gap here.

FYI, this ticket is to improve this in the python client:

  • https://github.com/Open-EO/openeo-python-client/issues/483

However, this also need support on the backend-side, which is not there yet (e.g. see https://github.com/Open-EO/openeo-geopyspark-driver/issues/536)

soxofaan avatar Mar 07 '25 12:03 soxofaan

Well now i know, but just in case i will need more properties, i know which document I can then look up to...

Unfortunately, at the moment, I'm afraid we don't have some king of listing/documentation on this as far as I know. Or do we @Pratichhya ? If you have a concrete question, the only solution currently to reach out for support, e.g. at https://forum.dataspace.copernicus.eu/c/openeo/28

soxofaan avatar Mar 07 '25 12:03 soxofaan

No, unfortunately, we don't have that documented anywhere yet.

Pratichhya avatar Mar 07 '25 12:03 Pratichhya