uvex_transients.simulation.core.SurveySimulator.generate_events#

SurveySimulator.generate_events(time_bins: Time | int, nside: int | None = None, order: str | None = None, sampling_factor: float | Mapping[str, float] | None = None) → EventCatalog[source]#

Sample a Monte Carlo realization of every registered transient type over a time grid.

For each transient type and each bin [t_k, t_{k+1}) of time_bins, events are sampled only within the HEALPix pixels the survey actually observes at some point between t_k and t_{k+1} + transient.duration_limit, i.e. only where an event exploding in this bin could plausibly still be caught by an observation before it fades below relevance. Explosion times themselves are drawn only within [t_k, t_{k+1}), so no event is double-counted across adjacent bins. The observed pixels are dilated by their neighbours (see SurveySchedule.get_observed_healpix_ids), so the sampled region contains every position the schedule can later match to an observation, including those whose own pixel center lies just outside a footprint. The extra events at the edge are simply never detected.

Two columns are computed once here, at generation time, so nothing downstream needs to re-derive them: luminosity_distance (interpolated per transient type off its own cached luminosity_distance_grid/ redshift_grid, rather than a fresh cosmology.luminosity_distance call per event) and ebv (one vectorized Milky Way dust-map query over every sampled position at once).

Parameters:
  • time_bins (Time or int) – Either an explicit, monotonically increasing Time array of n + 1 bin edges, or a positive int giving the number of evenly-spaced bins to divide survey_schedule’s full span into.

  • nside (int, optional) – HEALPix resolution used both to query the observed footprint and to sample event positions. If None (the default), uses config["healpix.default_nside"].

  • order (str, optional) – HEALPix pixel ordering scheme ("nested" or "ring"). If None (the default), uses config["healpix.default_order"].

  • sampling_factor (float or Mapping of str to float, optional) – Multiplier on the physical event rate, so the number of events drawn for each per-bin, per-type table is Poisson with mean sampling_factor times its expected count: 0.05 generates about one event in twenty, 1 the physical population, and 2 about twice as many. Because this thins (or superposes) the Poisson process itself, every event of a type stands for the same number of real events, and run_event_summary_action weights them accordingly. Either a single factor applied to every registered transient type, or a {type key: factor} mapping giving a different factor per type (a type left out of the mapping is sampled at its physical rate). The default is None (every type at its physical rate).

Returns:

One row per sampled event, across every registered transient type and time bin.

Return type:

EventCatalog

Raises:

ValueError – If sampling_factor is a mapping naming a key not in self._transients, or any factor is not a finite, positive number.