uvex_transients.simulation.event.Event.simulate_photometry#

Event.simulate_photometry(mission: Mission, bands: list | None = None, n_sigma: float | None = None) → QTable[source]#

Evaluate this event’s detectability at every observation in window_observations.

Every observation in window_observations is measured in one call to ~uvex_transients.models.core.base.SpectralModel.simulate_photometry, vectorized over observations and bands. Observations in observations are evaluated against transient.sed (dust folded in from this event’s own cached ebv). Those in background_observations – pre-explosion (from photometry_pre_window), plus any exposure running past photometry_post_window – never reach transient.sed: t < 0 isn’t in a SpectralModel’s valid domain (some light curve shapes are only smoothly wrong there, but others, e.g. an early-time 1/t singularity, diverge outright). They are measured against a true source flux of zero instead: pure background, at that observation’s own real exposure and observing geometry, flagged in_model=False.

The reported flux/magnitude at each (observation, band) is a Gaussian realization of the true (noiseless) flux, with the uncertainty the detector’s noise model (~m4opt.synphot.Detector.get_snr) implies for it: a synthetic measurement, not the ground truth. Physical SED parameters are sampled once, from seed. Each noise draw is a pure function of (seed, the observation's start time, the band's position in mission.detector.bandpasses) (see ~uvex_transients.utils.keyed_noise.keyed_standard_normal), so the same measurement gets the same noise whatever other observations or bands are simulated alongside it, and exactly matches the noise ~uvex_transients.simulation.core.SurveySimulator’s detection cuts apply to it.

mag_err is the usual linearized (first-order) propagation of flux_err through the magnitude log transform – a good description of the uncertainty only while it’s small relative to flux, i.e. at high SNR. It is not a substitute for a real confidence interval: because magnitude is a nonlinear (logarithmic) function of flux, a symmetric interval in flux is an asymmetric one in magnitude, and that asymmetry grows as SNR drops – comparing against ab_mag/mag_err as if they were a plain Gaussian pull systematically reads as biased at low SNR even when the underlying flux draw has no bias at all. flux_upper/flux_lower and mag_upper/mag_lower are the actual n_sigma interval, built the correct way around: bound flux symmetrically first (where the noise is actually Gaussian), then transform each bound to magnitude separately, rather than propagating one linearized width through the transform. For a background_observations row this interval is exactly the pure-noise upper limit expected of a non-detection: mag_upper is nan (no faint bound – the “source” is, by construction, never securely distinguished from zero flux) and mag_lower is the n_sigma detection depth reached by that observation’s own real exposure/background.

Parameters:
  • mission (m4opt.missions.Mission) – Supplies the ~m4opt.synphot.Detector (bandpasses, background, …) evaluated against.

  • bands (list of str, optional) – Which of mission.detector’s bandpasses to evaluate. Defaults to every bandpass the detector has.

  • n_sigma (float, optional) – Width, in multiples of flux_err, of the flux_upper/flux_lower/ mag_upper/mag_lower interval. If None (the default), uses config["simulation.detection_n_sigma"] (5 out of the box).

Returns:

One row per (observation, band), sorted by obs_time then band, with columns event_id, obs_time, rel_time (obs_time - t_explosion, in days – negative for a background_observations row), exptime, band, snr, flux/flux_err (Jy), flux_upper/flux_lower (Jy, flux ± n_sigma*flux_err), ab_mag/mag_err, mag_upper/mag_lower – the n_sigma interval transformed to magnitude, brighter bound first: mag_lower (from flux_upper) is always finite when flux_upper>0; mag_upper (from flux_lower) is nan whenever flux_lower<=0, i.e. whenever the source isn’t securely distinguished from zero flux at n_sigma – the correct behavior is a one-sided (no faint bound) result there, not a spuriously finite one – and in_model, True for a row from observations (a real evaluation of transient.sed) and False for one from background_observations (pure background/non-detection, transient.sed never evaluated). snr is the measured SNR, flux / flux_err of the noisy flux realization: the quantity a detection threshold applies to. flux/flux_err/snr/ab_mag/mag_err are nan wherever the detector’s noiseless SNR for the true flux is non-positive or non-finite (ab_mag/mag_err are also nan wherever the noisy flux realization itself came out non-positive). Empty (but correctly typed) if window_observations is empty.

Return type:

astropy.table.QTable