uvex_transients.surveys.footprints.base.combine_footprints#

uvex_transients.surveys.footprints.base.combine_footprints(name: str, operation: str, footprints: Sequence[SurveyFootprint | str], description: str | None = None, **kwargs) → SurveyFootprint[source]#

Build and register a new footprint from set operations on existing ones.

The result is an ordinary SurveyFootprint whose generator is combine_MOC. It is lazy and, by default, cached. Its cache_key includes the operands’ keys, so changing an operand invalidates the combined cache too.

Parameters:
  • name (str) – Name of the new footprint (observatory:survey:region).

  • operation ({"union", "intersection", "difference", "xor"}) – See combine_MOC.

  • footprints (sequence of SurveyFootprint or str) – Operands, or their names. They must be registered in default_registry.

  • description (str, optional) – Description. Default: generated from the operation and operand names.

  • **kwargs – Passed to SurveyFootprint (e.g. persist, version, MOC_max_order). persist defaults to True.

Returns:

The new, registered footprint.

Return type:

SurveyFootprint

Raises:
  • ValueError – If operation is unknown or footprints is empty.

  • KeyError – If an operand is not registered, or name already is.