uvex_transients.simulation.event_catalog.EventCatalog.get_events#

EventCatalog.get_events(ids: int | ndarray | list, transients: dict[str, TransientBase], schedule: SurveySchedule) → Event | list[Event][source]#

Reconstruct one or more Event objects from their event_id.

EventCatalog itself holds no live reference to transients/schedule (see the module docstring), so both must be supplied here – typically the same dict/SurveySchedule the catalog was generated from.

Parameters:
  • ids (int or array_like of int) – One event id, or several. A scalar ids returns a single Event; anything array-like returns a list of Event, in the order given.

  • transients (dict[str, TransientBase]) – Transient-type instances, keyed by the same names used in the transient_type column (e.g. SurveySimulator.transient_collection).

  • schedule (SurveySchedule) – The survey schedule to check each reconstructed event’s visibility against.

Returns:

Reconstructed event or events corresponding to the requested event ids.

Return type:

Event or list[Event]

Raises:

KeyError – If an id isn’t present in this catalog, or its transient_type isn’t a key of transients.