eomatch.finder.sat2insitu.Sat2InSituMUFinder.to_matchup_set

eomatch.finder.sat2insitu.Sat2InSituMUFinder.to_matchup_set#

Sat2InSituMUFinder.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 satellite and the in-situ site). Products returned are filtered to those whose platform matches the platform the query was issued for – a collection can cover more than one platform (e.g. RadCalNet’s RCN_BOA, which covers every registered site: GONA, RVUS, etc.), so without this filter a query scoped to one site could pick up another site’s products too. Matches to_matchup_set()’s equivalent filter (there, guarding against e.g. LANDSAT_C2L1 covering both Landsat-8 and Landsat-9).

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() – products are compared as intervals, not instants, so a satellite pass anywhere inside a RadCalNet product’s own multi-hour daylight window counts as a zero gap, not the difference from the window’s start). Geometric overlap alone isn’t enough here – RadCalNet’s own product footprint is a fixed point/ROI for the site, so every satellite pass over that site trivially overlaps every one of that site’s RadCalNet products, including ones from other days pulled in by a broad event query window (RadCalNet’s own date matching is day-of-year granularity, not time-of-day). Without the time check, a single satellite pass could get paired with RadCalNet products many hours or even days away, which fails downstream (the RadCalNet reader raises when asked to subset to a time its file has no data for) or, worse, silently produces a nonsensical matchup that does happen to find nearby data. Events for which fewer than two platforms return products are skipped.

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. Matches to_matchup_set()’s equivalent behaviour.

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.