CS-SI / eodag

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

Query with onda provider inconsistent #928

Open YuLouise opened 10 months ago

YuLouise commented 10 months ago

[SWOT expertise center] python 3.9.16 eodag 2.10.0

I ran a search for Sentinel-1 products with ONDA provider and I get inconsistent results. In short, I identified two issues:

I am attaching a screenshot of my notebook to illustrate my issue (ONDA credentials are hidden on purpose), and below are some code snippets for copy-paste needs. EODAG_test

import eodag

config = "eodag.yml"
dag = eodag.EODataAccessGateway(config)
dag.set_preferred_provider(u'onda')
search_criteria = {
    "start": "2023-05-16",
    "end": "2023-05-17",
    "platform": "Sentinel-1",
    "geom": wkt_geometry
}
search_results = dag.search_all(**search_criteria)
[x.properties["id"] for x in search_results]
search_results = dag.search_all(**search_criteria)
[x.properties["id"] for x in search_results]
search_criteria = {
    "start": "2023-05-16",
    "end": "2023-05-17",
    "platform": "SENTINEL1",
    "geom": wkt_geometry
}
search_results = dag.search_all(**search_criteria)
[x.properties["id"] for x in search_results]
search_criteria = {
    "productType": "S1_SAR_GRD",
    "start": "2023-05-16",
    "end": "2023-05-17",
    "platform": "SENTINEL1",
    "geom": wkt_geometry
}
search_results = dag.search_all(**search_criteria)
[x.properties["id"] for x in search_results]
sbrunato commented 10 months ago

Hello @YuLouise and thanks for this feedback.

EODAG interprets the "platform" property of the search results differently depending on the search criteria: sometimes "SENTINEL1", sometimes "Sentinel-1".

When productType is None in the search criteria and the platform is successfully identified by EODAG, EODAG searches only the first product type corresponding to the platform, instead of all the product types that could match, thus yielding partial results.

That is "almost" the expected behavior. EODAG performs searches one product-type at a time. If you only give platform as query parameter, it will try to guess a product type using it and use the first matching.

If no product type can be guessed, or if you give an unknown product-type, generic settings from GENERIC_PRODUCT_TYPE will be used.

When no product type can be found from the internal product-types catalog, EODAG fetches external product types using product types discovery to update its product types list. In your example, this is why your search was performed on planetary_computer using sentinel-1-rtc.