Accessing the core spectrograph and detector parameters

Accessing the core spectrograph and detector parameters#

Behind every Lazuli target is a slicersim.Simulation object, which holds the instrument model (telescope, spectrograph, detector) and the scene. This notebook shows how to access some of its key quantities: the detector quantum efficiency, the spectral resolution and the effective transmission.

import slicersim

Let us load a SN Ia target and access its simulation attribute.

lazuli_snia = slicersim.LazuliSupernova(redshift=1)
# the simulation is where everything happens
simulation = lazuli_snia.simulation

Quantum efficiency#

detector.qe is a function of wavelength (in Å) returning the detector quantum efficiency.

lbda = simulation.spectrograph.lbda
qe = simulation.detector.qe
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.fill_between(lbda, qe(lbda))
ax.set_ylim(0, 1)
ax.set_xlim(lbda[0], lbda[-1])
ax.set_xlabel("wavelength [Å]")
ax.set_ylabel("quantum efficiency")
Text(0, 0.5, 'quantum efficiency')
../_images/dca9aa8a4b3289bd763036d110c89058615c2bdae92f635cc532b15ab93e01c5.png

Spectral resolution#

The resolving power R = λ/Δλ is computed from the wavelength binning, Δλ being the size of a resolution element, i.e. dispersion_resolution wavelength bins (this is also what spectrograph.get_resolving_power() returns). The dashed line shows R=100.

import numpy as np
fig, ax = plt.subplots()
ax.plot(lbda[:-1], lbda[:-1] / (simulation.spectrograph.dispersion_resolution * np.diff(lbda)))
ax.axhline(100, ls="--", color="0.5")
ax.set_xlabel("wavelength [Å]")
ax.set_ylabel("resolving power R")
Text(0, 0.5, 'resolving power R')
../_images/703960222a81a4e26ce7ad2ced6eaa9d9b94e4fdb2f3b8b69130099e95798049.png

Effective transmission#

get_effective_transmission() returns the conversion factor between the input flux (in erg/s/cm²/Å) and the signal recorded by the detector, in ADU, for the current configuration.

lbda, transmission = simulation.get_effective_transmission()
fig, ax = plt.subplots()

ax.fill_between(lbda, transmission)
ax.set_xlabel("wavelength [Å]")
ax.set_ylabel("ADU / (erg/s/cm$^2$/Å)")
ax.set_ylim(0)
(0.0, 3.9982368123821064e+20)
../_images/9b004ed3a61d6b5a07ec306b5cac101768eeec9ed942b3da4fe16837cad7470b.png