CS-SI / eodag

Earth Observation Data Access Gateway
https://eodag.readthedocs.io
Apache License 2.0
326 stars 44 forks source link

Harmonization of polarization filtering key #1305

Open LucHermitte opened 2 months ago

LucHermitte commented 2 months ago

Describe the bug

It seems not all data providers use the same key (on API side) as filter for the polarization.

An issue has been reported to S1Tiling: the search requests we emit for S1_SAR_GRD products on COP Dataspace were not valid: PolarizationMode isn't understood/expected by cop_dataspace.

It happens because our search request is defined as such:

page_products, _ = dag.search(
        page=page, items_per_page=self.__searched_items_per_page,
        productType=product_type,
        raise_errors=True,
        start=first_date, end=last_date,
        box=extent,
        # If we have eodag v1.6+, we try to filter product during the search request
        polarizationMode=dag_polarization_param,
        sensorMode="IW",
        orbitDirection=dag_orbit_dir_param,        # None => all
        relativeOrbitNumber=dag_orbit_list_param,  # List doesn't work. Single number yes!
        platformSerialIdentifier=dag_platform_list_param,
)

Which is translated into the following request: https://catalogue.dataspace.copernicus.eu/resto/api/collections/Sentinel1/search.json?polarizationMode=VV%20VH&sensorMode=IW&orbitDirection=ascending&startDate=2023-01-01&completionDate=2023-12-31&geometry=POLYGON%20((5.4998%2044.0998,%205.4998%2045.1255,%206.9361%2045.1255,%206.9361%2044.0998,%205.4998%2044.0998))&productType=GRD&maxRecords=20&page=4&exactCount=1&productType=GRD&maxRecords=20&page=4&exactCount=1).

I found issue #154 that seems to be closely related to our issue. But it isn't explicit about which parameter is expected by EODAG API to filter polarisations.

"polarisation" seems to work as it appears to be what is expected by PEPS and by COP Dataspace. I could observe that PolarizarionMode is translated into polarisation for peps, and that PolarizationChannels is translated in polarisation for cop_dataspace this time.

Unfortunately neither PolarizarionMode nor PolarizationChannels seem to cover all data providers. At best I've found https://eodag.readthedocs.io/en/stable/add_provider.html?highlight=polarisation#provider-eodag-specific-parameters-csv that list both parameters, but I see no single parameter that works for all data providers to request "VV VH" for instance.

If I'm not mistaken, while issue #154 is closed, actually, EODAG API isn't unified yet on this topic.

So. Is there something I've missed and I haven't used the correct parameters? Or is there something missing in EODAG API?

For information, I've opened for following issue on S1Tiling side about the issue at hand: S1Tiling: https://gitlab.orfeo-toolbox.org/s1-tiling/s1tiling/-/issues/168