lazuli_etc#
- lazuli_etc(lbda, flux, snr, per_resolution=True, mag=None, band='bessellb', lbda_range=[4000, 6800], frame='rest', statistic=<function nanmean>, max_group=None, nmd=None, time_details=False)[source]#
Compute the exposure time needed to reach a given SNR on any spectrum.
This builds a
LazuliTargetpoint source from the input spectrum, sets the detector read-out mode, then finds the read-out configuration (MACC mode and number of ramps) reaching the target signal-to-noise ratio (seesetup_to_snr) and returns the corresponding exposure time.- Parameters:
lbda (array_like) – Wavelengths of the spectrum in Angstrom. Should cover the Lazuli bandpass.
flux (array_like) – Flux of the spectrum, in erg/s/cm^2/A if
magis None, in arbitrary units otherwise.snr (
float) – Target signal-to-noise ratio.per_resolution (
bool, optional) – If True,snris given per spectral resolution element, otherwise per wavelength bin. Default is True.mag (
float, optional) – If given,fluxis rescaled so that the spectrum has this magnitude inband. Default is None.band (
str, optional) – Bandpass ofmag(any sncosmo bandpass name). Ignored ifmagis None. Default is"bessellb".lbda_range (
listoffloat, optional) – Wavelength range[min, max]in Angstrom over which the SNR is computed. Default is[4000, 6800].frame (
str, optional) – Reference frame oflbda_range:"rest"(rest-frame) or"obs"(observer-frame). Default is"rest".statistic (callable, optional) – Function used to summarise the SNR over
lbda_range. Default isnumpy.nanmean.max_group (
int, optional) – Maximum number of groups in a single ramp. If None, the current instrument configuration is kept. Default is None.nmd (
tupleofint, optional) – Detector MACC mode(n_groups, n_frames_per_group, n_drops). If None, the current instrument configuration is kept. Default is None.time_details (
bool, optional) – If True, return the full timing details instead of the total exposure time. Default is False.
- Returns:
exptime (
floatordict) – Total exposure time in seconds (including all ramps), or, iftime_detailsis True, a dict of detector times in seconds ("integration_time","exposure_time","tframe","tgroup"and"total_exptime").target (
LazuliTarget) – The target, configured to the read-out mode reachingsnr.
See also
lazuli_sn_etcSame for SN Ia models.
Notes
The input spectrum has no redshift, so
frame="rest"andframe="obs"select the same wavelengths.Examples
>>> lbda = np.arange(3_000, 20_000, 0.5) >>> flux = np.ones_like(lbda) >>> exptime, target = lazuli_etc(lbda, flux, snr=10, mag=22, band="bessellb")