eomatch.finder.sat2sat.Sat2SatMUFinder.to_matchup_set

eomatch.finder.sat2sat.Sat2SatMUFinder.to_matchup_set#

Sat2SatMUFinder.to_matchup_set(mu_events: List[MatchupEvent]) → List[MatchupEvent][source]#

Query scrappi for each event and build per-event MatchupSet objects.

For each MatchupEvent, one scrappi query is issued per platform. The query geometry is the configured site bounding box (min_lat/max_lat/min_lon/max_lon in the context) when one is set, falling back to the event’s own geometry otherwise — the event geometry from orbitx can be hundreds of km wide (returning products outside the site) or narrower than the site on one axis (missing products that do cover the site), whereas the event bbox has already passed filter_events() so searching the full site bbox is safe.

Products returned by scrappi are further filtered to those whose platform matches the platform the query was issued for — a collection can cover more than one platform (e.g. LANDSAT_C2L1, which contains both Landsat-8 and Landsat-9 products), so without this filter a query for one platform could return products for another. This relies on scrappi returning product.platform values in the same short-code form used by platforms in the config and passed to orbitx (e.g. S2A, LS9) — see parse_platform_from_name in scrappi’s BaseAPICallHandler.

If the provider_by_collection config dict has an entry for a query’s collection, the query is tagged with provider=<name>, which scrappi forwards unchanged to eodag’s search(). eodag disables its usual try-every-provider-in-priority-order fallback whenever provider is set, so this is a way to pin a specific eodag provider per collection for a run (e.g. to skip several providers that are known to be slow, unauthenticated, or unavailable for a given collection) without affecting other runs or other collections. Collections without an entry are queried with eodag’s normal provider fallback behaviour. A misconfigured provider name fails silently (no results, since fallback is disabled) rather than raising, so it is worth double-checking the provider name against your eodag config if a collection unexpectedly stops returning products after setting this.

Products returned for each platform are combined via a Cartesian product; a combination becomes a Matchup only if every product geometrically overlaps and every pair’s time ranges are within time_diff_threshold of each other (see all_products_within_time_diff()) – geometric overlap alone can accept pairings from different, unrelated crossovers of the same general area (see the identical check and its rationale in to_matchup_set()). Events for which fewer than two platforms return products are skipped.

Parameters:

mu_events – list of MatchupEvent objects to query.

Returns:

the same list with matchup_set populated for events that produced at least one matchup.