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 < 0isn’t in a SpectralModel’s valid domain (some light curve shapes are only smoothly wrong there, but others, e.g. an early-time1/tsingularity, 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, flaggedin_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_erris the usual linearized (first-order) propagation offlux_errthrough the magnitude log transform – a good description of the uncertainty only while it’s small relative toflux, 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 againstab_mag/mag_erras 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_lowerandmag_upper/mag_lowerare the actualn_sigmainterval, 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_upperisnan(no faint bound – the “source” is, by construction, never securely distinguished from zero flux) andmag_loweris then_sigmadetection 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 (
listofstr, optional) – Which of mission.detector’s bandpasses to evaluate. Defaults to every bandpass the detector has.n_sigma (
float, optional) – Width, in multiples offlux_err, of theflux_upper/flux_lower/mag_upper/mag_lowerinterval. If None (the default), usesconfig["simulation.detection_n_sigma"](5 out of the box).
- Returns:
One row per (observation, band), sorted by
obs_timethenband, with columnsevent_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– then_sigmainterval transformed to magnitude, brighter bound first:mag_lower(fromflux_upper) is always finite whenflux_upper>0;mag_upper(fromflux_lower) isnanwheneverflux_lower<=0, i.e. whenever the source isn’t securely distinguished from zero flux atn_sigma– the correct behavior is a one-sided (no faint bound) result there, not a spuriously finite one – andin_model,Truefor a row from observations (a real evaluation of transient.sed) andFalsefor one from background_observations (pure background/non-detection, transient.sed never evaluated).snris the measured SNR,flux / flux_errof the noisyfluxrealization: the quantity a detection threshold applies to.flux/flux_err/snr/ab_mag/mag_errarenanwherever the detector’s noiseless SNR for the true flux is non-positive or non-finite (ab_mag/mag_errare alsonanwherever the noisyfluxrealization itself came out non-positive). Empty (but correctly typed) if window_observations is empty.- Return type: