uvex_transients.simulation.core.SurveySimulator.run_event_summary_action#

SurveySimulator.run_event_summary_action(catalog: EventCatalog, exposure: ExposureCatalog, photometry: QTable | PhotometryCatalog, mission: Mission, snr_threshold: float, rise_sigma: float = 3.0, rise_mags: Sequence[float] = (1.0, 2.0, 3.0), processing_delay: Quantity | float = 0.0, lookback: float | None = None, bands: list[str] | None = None, chunk_size: int | None = None, footprints: list[str] | None = None, color_bands: list[str] | None = None) → QTable[source]#

Build a per-event summary table: when each event was first and last seen, and how it peaked.

One row per event in catalog, in catalog’s order, so everything needed to study detection timing, cadence, and peak behaviour is in one small table and does not require replaying the full event list. Detection quantities come from a single pass over the schedule-aware epochs (see iter_epochs); the peak quantities come from photometry.

The table’s meta carries what is needed to turn any selection of its rows into an expected number of real events with confidence bounds (see ~uvex_transients.simulation.rates.estimate_yield): the generation-time count of each type from catalog’s pre_cut_counts, each type’s intrinsic expected event count from exposure, and each type’s rate-uncertainty factors.

A detection is an epoch after the explosion whose measured SNR exceeds snr_threshold, exactly as in filter_by_snr. The first-visit exclusion of that cut is not re-applied here, so pass a catalog that has already been through it if that matters.

Parameters:
  • catalog (EventCatalog) – The events to summarize, typically the output of an SNR cut. It must carry pre_cut_counts (set by generate_events), which survive every cut.

  • exposure (ExposureCatalog) – Typically compute_effective_exposure’s own output. Supplies each type’s expected number of UVEX events.

  • photometry (QTable or PhotometryCatalog) – Synthetic photometry of catalog, typically run_photometry_action’s output. An event with no rows in it has masked peak columns.

  • mission (m4opt.missions.Mission) – Forwarded to iter_epochs.

  • snr_threshold (float) – The detection threshold.

  • rise_sigma (float, optional) – Minimum significance of the rise from a non-detection to the first detection, \((f_{\rm det} - f_{\rm and}) / \sqrt{\sigma_{\rm det}^2 + \sigma_{\rm and}^2}\), for that non-detection to count in t_last_constraining_nondet. The default is 3.

  • rise_mags (sequence of float, optional) – Magnitude rises to time, each giving a t_rise_<N>mag column. The default is (1, 2, 3). An empty sequence adds no such columns.

  • processing_delay (Quantity or float, optional) – Fixed ground-segment latency added to the downlink completion time to get t_alert. Bare numbers are interpreted as hours. The default is 0.

  • lookback (float, optional) – Days before each explosion to search for non-detections. None (the default) searches back to the start of the schedule.

  • bands (list of str, optional) – Which of the mission’s bands to measure, as in iter_epochs; the default is all of them. Each one also gets its own set of per-band columns (see Returns).

  • chunk_size (int, optional) – Forwarded to iter_epochs.

  • footprints (list of str, optional) – Registered footprint names to flag each event against. The default is the LMLZ wide and deep surveys and the Magellanic Clouds survey.

  • color_bands (list of str, optional) – The two bands whose magnitude difference gives peak_color, as first - second. The default is ["FUV", "NUV"].

Returns:

One row per event, with columns:

  • event_id, transient_type, parameter_seed, time_bin, redshift, luminosity_distance, ebv, coord, healpix_id and t_explosion, copied from catalog. t_explosion is the one quantity an observer could not know.

  • in_<footprint>: one boolean per footprint, with : replaced by _ in the name (for example in_uvex_lmlz_deep).

  • weight: the expected number of real events each sampled event stands for, expected_events[type] / n_pre_cut[type]. Summing it over any selection gives that selection’s expected yield. Every event of a type shares it, which is exact because sampling_factor thins the Poisson process itself, so all of a type’s events have the same inclusion probability.

  • n_obs, t_first_obs, t_last_obs: observations of the event’s position after the explosion, and the times of the first and last.

  • n_det, t_first_det, t_last_det: detections, and the times of the first and last. The times are masked when n_det is zero.

  • field_id: the schedule field of the first detection’s observation.

  • t_alert: the completion of the first downlink after the first detection’s observation ends, plus processing_delay. Masked if no downlink follows.

  • t_last_nondet, last_nondet_snr: the last epoch before the first detection with SNR at or below the threshold, and its measured SNR. This may be before the explosion. Masked if the first observation was already a detection.

  • t_last_constraining_nondet: the last such epoch whose rise to the first detection is at least rise_sigma.

  • t_rise_<N>mag, one per entry of rise_mags (t_rise_1mag, t_rise_2mag and t_rise_3mag by default; a fractional N has its point written p, as in t_rise_0p5mag): the first detection at least N magnitudes brighter than the detection limit (snr_threshold times the uncertainty) of t_last_nondet’s epoch. Any detection can be the one, not only the first. Subtracting t_last_nondet gives the observed bracket on a rise of N magnitudes. Masked if there is no t_last_nondet, or no detection gets that far above its limit. It is the earliest of the per-band rises below, each against its own band’s limit.

  • For each band in bands, the same detection quantities from that band’s own measurements, with the band’s name as a suffix (n_det_FUV, t_first_det_FUV, t_last_det_FUV, t_last_nondet_FUV, last_nondet_snr_FUV, t_last_constraining_nondet_FUV, t_rise_1mag_FUV, and so on). A band’s first detection is its own, so its last non-detection is the last epoch before that where this band was at or below the threshold, and may follow the any-band first detection. The unsuffixed columns above describe the event in any band: an epoch is a detection if its best band is one. n_obs, field_id and t_alert have no per-band form.

  • peak_snr, peak_mag, peak_color, peak_time: the highest-SNR measurement in photometry, its AB magnitude, the color of that observation (masked if either band is missing or not finite), and its time.

The table’s meta records the parameters of the call and, keyed by transient type, n_pre_cut (generated events), expected_events (intrinsic UVEX events, from exposure) and rate_ci (the type’s (lower, upper) rate factors), for every type in catalog’s pre_cut_counts.

Return type:

QTable

Raises:
  • TypeError – If catalog is not an EventCatalog.

  • KeyError – If a transient type in catalog’s pre_cut_counts has no tabulated exposure in exposure, or is not one of this simulator’s transients.

  • ValueError – If catalog has no pre_cut_counts (it was built by hand, or read from a file written before they were recorded), or color_bands does not have exactly two entries.

See also

filter_by_snr

The definition of a detection this action builds on.

run_photometry_action

Produces the photometry input.

uvex_transients.simulation.rates.estimate_yield

Turns a selection of rows into expected events.

Examples

summary = simulator.run_event_summary_action(
    catalog=detected,
    exposure=exposure,
    photometry=photometry,
    mission=mission,
    snr_threshold=5.0,
)