uvex_transients.simulation.core.SurveySimulator.generate_events#
- SurveySimulator.generate_events(time_bins: Time | int, nside: int | None = None, order: str | None = None, downsample: int | Mapping[str, int] | 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 betweent_kandt_{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.Two columns are computed once here, at generation time, so nothing downstream ever re-derives them:
luminosity_distance(interpolated per transient type off its own cachedluminosity_distance_grid/redshift_grid, rather than a fresh cosmology.luminosity_distance call per event) andebv(one vectorized Milky Way dust-map query over every sampled position at once).- Parameters:
time_bins (
Timeorint) – Either an explicit, monotonically increasing Time array ofn + 1bin 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), usesconfig["healpix.default_nside"].order (
str, optional) – HEALPix pixel ordering scheme ("nested"or"ring"). If None (the default), usesconfig["healpix.default_order"].downsample (
intorMappingofstrtoint, optional) – Downsample the number of events generated, by drawing a random subset (without replacement) of each per-bin, per-type table rather than a fixed stride – seeded reproducibly off simulation_seed. 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 not downsampled at all). The default isNone(no downsampling).
- Returns:
One row per sampled event, across every registered transient type and time bin.
- Return type:
EventCatalog- Raises:
ValueError – If downsample is a mapping naming a key not in self._transients.