uvex_transients.models.core.base.ComposedSpectralModel.simulate_photometry#
- ComposedSpectralModel.simulate_photometry(t: PhysicalInput, exptime: Quantity, detector: Detector, coord: SkyCoord, *, background: SourceSpectrum | None = None, bands: list | None = None, observer_location: EarthLocation | None = None, obstime: Time | None = None, redshift: PhysicalInput | None = None, luminosity_distance: Quantity | None = None, angular_diameter_distance: Quantity | None = None, proper_distance: Quantity | None = None, cosmology: FLRW | None = None, ebv: float | Quantity | FloatArray | None = None, dust_law: str | None = None, n_sigma: float | None = None, sys_err: float | Mapping[str, float] | None = None, rng: RNGInput = None, **parameters: ParameterValue) QTable#
Simulate noisy synthetic photometry of this model at given time(s), against a real detector.
The noise-aware counterpart to
mag()/flux()/as_source_spectrum(): those give the noiseless truth; this adds the detector’s own noise model (get_snr(), the same OIR CCD equationsignal_to_noise_oir_ccdimplements) and reports a synthetic measurement – one Gaussian realization of the true flux at each requested time and band, at that time/band’s own implied uncertainty.Deliberately independent of any
SurveyScheduleorEvent: t/exptime are whatever times/exposures the caller wants evaluated (e.g. a target-of-opportunity’s own chosen observing cadence), not ones a schedule was queried for. background is a required, explicit choice for the same reason – rather than an implicit default read off detector. This lets a caller decide what physics to include (dust, via ebv, is always folded into the source flux itself; the Milky Way’s diffuse UV glow via ~m4opt.synphot.background.GalacticBackground; zodiacal light via ~m4opt.synphot.background.ZodiacalBackground; …) without needing to know, let alone undo, whatever combination a particular detector happens to ship with (e.g.m4opt.missions.uvex’s own detector defaults toGalacticBackground() + ZodiacalBackground()). If background is given, it replaces detector’s ownbackgroundfor this call only (detector itself is never mutated); if omitted, detector’s ownbackgroundis used unchanged.observer_location/obstime matter only insofar as background actually depends on them: GalacticBackground reads only sky position (coord, by way of m4opt.synphot.observing’s target coordinate), so for a dust-and-Galactic-only call – e.g. a target of opportunity whose real observing time isn’t known yet – neither needs to be real, and both default to fixed placeholders. Pass real values (e.g. a mission’s own
observer_location(obstime)) only when background includes a term that actually varies with them, such as ZodiacalBackground (sun-relative sky position, from obstime) or EarthshineBackground (spacecraft position, from observer_location).- Parameters:
t (
array-likeorQuantity) – Time(s) since explosion, shape(N,)(or scalar, promoted to shape(1,)) – one entry per requested observation. Unlikeas_source_spectrum(), no manual trailing batch axis is needed; this method inserts and removes it internally.exptime (
Quantity) – Exposure duration(s), scalar (applied to every entry of t) or shape matching t.detector (
Detector) – Supplies bandpasses, collecting area, plate scale, and detector noise terms (dark/read noise, gain, …). Its ownbackgroundis used only if background isn’t given – see above.coord (
SkyCoord) – Scalar sky position of the target.background (
SourceSpectrum, optional) – Sky background surface brightness to simulate against for this call – e.g. ~m4opt.synphot.background.GalacticBackground() alone, or combined with others via+. If None (the default), detector’s ownbackgroundis used.bands (
list, optional) – Which of detector’s bandpasses to evaluate. Defaults to every bandpass detector has.observer_location (
EarthLocation, optional) – See above; defaults to a fixed placeholder location, correct whenever background doesn’t depend on it.obstime (
Time, optional) – See above; defaults to a fixed placeholder epoch, correct whenever background doesn’t depend on it.redshift (
array-likeorQuantity, optional) – Seeas_source_spectrum().luminosity_distance (
Quantity, optional) – Seeas_source_spectrum().angular_diameter_distance (
Quantity, optional) – Seeas_source_spectrum().proper_distance (
Quantity, optional) – Seeas_source_spectrum().cosmology (
FLRW, optional) – Seeas_source_spectrum().ebv (
float,Quantity,numpy.ndarray, orstr, optional) – Seeas_source_spectrum().dust_law (
float,Quantity,numpy.ndarray, orstr, optional) – Seeas_source_spectrum().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).sys_err (
floatorMapping[str,float], optional) – A per-band systematic calibration error floor, in magnitudes, combined in quadrature with the shot-noise uncertainty detector itself computes (viaget_snr(), the OIR CCD equation – source and sky Poisson noise plus detector read/dark noise only, with no notion of flat-fielding, PSF-fit, or zeropoint calibration systematics). Folded into the noise realization itself, not just reported as a wider flux_err around an unchanged draw – otherwise the scatter of simulated points across repeated visits would be narrower than what their own error bars claim. A bare float applies the same floor to every band in bands; a mapping must have an entry for every band in bands. If None (the default, and the prior behavior), no systematic floor is added.rng (
numpy.random.Generator,int, orNone) – Random-number source for the noise realization; seeget_rng().**parameters – This model’s parameter values. See
eval_log_cgs().
- Returns:
One row per (time, band), sorted by
tthenband, with columnst,exptime,band,snr,flux/flux_err(Jy),flux_upper/flux_lower(Jy,flux ± n_sigma*flux_err),ab_mag/mag_err, andmag_upper/mag_lower– then_sigmainterval transformed to magnitude, brighter bound first. Seesimulate_photometry()for the exact semantics of every column (this method implements the same math). If sys_err is given,snr/flux_err/mag_err(and everything derived from them) reflect the combined shot-noise-plus-systematic uncertainty.- Return type:
- Raises:
ValueError – If coord is not scalar, if bands contains a name detector doesn’t have, if exptime is neither scalar nor shaped like t, or if sys_err is a mapping missing an entry for one of bands.