eomatch.Matchup.from_stac_item

eomatch.Matchup.from_stac_item#

classmethod Matchup.from_stac_item(item: Item, context: Any | None = None) → Matchup[source]#

Reconstruct a Matchup from a STAC Item.

Source ProductItems are rebuilt from the derived_from link targets, via product_item_from_stac() – pass context (e.g. the owning MatchupCatalogue’s own context) so a rebuilt product’s own .context carries whatever config it was originally found with (credentials, api.offline_archive_paths for an offline-archive-backed collection, …) – without it, product.download_product()/ resolve_product_path() fall back to a bare default context and can’t re-locate a product outside scrappi’s organised online-download layout (e.g. GISTDA THEOS-1’s own offline archive), silently guessing the wrong path instead. context omitted leaves this exactly as before: no filesystem/API configuration – call product.set_api()/product.set_fs() yourself before attempting a download. The item’s properties dict (e.g. enricher-computed roi_cloud_cover, collocation_area_km2, insitu_time_diff_nearest_s) is copied onto the returned Matchup’s own properties – see run(), which merges it into the built DataTree’s root attributes.

Parameters:
  • item – STAC Item produced by to_stac_item().

  • context – optional context to build each rebuilt product’s own .context from.

Returns:

Matchup object.