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.

Products returned for each platform are combined via a Cartesian product and those where all products geometrically overlap become Matchup objects. 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.