lazuli_etc

Contents

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 LazuliTarget point 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 (see setup_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 mag is None, in arbitrary units otherwise.

  • snr (float) – Target signal-to-noise ratio.

  • per_resolution (bool, optional) – If True, snr is given per spectral resolution element, otherwise per wavelength bin. Default is True.

  • mag (float, optional) – If given, flux is rescaled so that the spectrum has this magnitude in band. Default is None.

  • band (str, optional) – Bandpass of mag (any sncosmo bandpass name). Ignored if mag is None. Default is "bessellb".

  • lbda_range (list of float, optional) – Wavelength range [min, max] in Angstrom over which the SNR is computed. Default is [4000, 6800].

  • frame (str, optional) – Reference frame of lbda_range: "rest" (rest-frame) or "obs" (observer-frame). Default is "rest".

  • statistic (callable, optional) – Function used to summarise the SNR over lbda_range. Default is numpy.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 (tuple of int, 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 (float or dict) – Total exposure time in seconds (including all ramps), or, if time_details is 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 reaching snr.

See also

lazuli_sn_etc

Same for SN Ia models.

Notes

The input spectrum has no redshift, so frame="rest" and frame="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")