eomatch.datatree.BuildMUDT.run

Contents

eomatch.datatree.BuildMUDT.run#

BuildMUDT.run(matchup: Matchup, collection_read_args: dict | None = None, crop_to_shared_valid_extent: bool | None = None) → xr.DataTree[source]#

Build a matchup DataTree from a Matchup.

Per-collection vars_sel, read_params, and processors defaults are read from the read section of the context config (see _resolve_read_kwargs()). collection_read_args overrides those defaults at call time.

The returned DataTree’s root attrs describe the matchup itself – always matchup:id/matchup:time_diff_abs/matchup:collocation_region_wkt, plus (if this matchup was loaded from a saved catalogue item) every enricher-computed property it carries, e.g. roi_cloud_cover, collocation_area_km2, insitu_time_diff_nearest_s – see _matchup_root_attrs(). This makes the saved DataTree self-describing: a user with just the .nc file, no access to the source STAC catalogue, can still see why this pairing was selected and whether it passed any quality filter.

Parameters:
  • matchup – matchup whose products to read.

  • collection_read_args – per-collection call-time overrides keyed by STAC collection ID (see _resolve_read_kwargs()).

  • crop_to_shared_valid_extent – if True/False, overrides the read. crop_to_shared_valid_extent context config setting for this call. If None (the default), that config setting is used, itself defaulting to True if unset. See crop_to_shared_valid_extent().

Returns:

DataTree with one node per sensor, named by collection ID.

Raises:

ValueError – if matchup.products is None, or – only when cropping is enabled – if two or more products’ valid-data extents don’t overlap (see crop_to_shared_valid_extent()). Both cases raise the same exception type.