Changing the dispersion resolution#
The dispersion resolution (dispersion_resolution) is the number of detector pixels spanned
by a resolution element, i.e. the footprint of the point spread function (PSF) on the detector.
A value of 2 corresponds to Nyquist sampling. The default Lazuli configuration uses 2.3.
Nyquist sampling is the optimum:
below it, the PSF is under-sampled, and hence cannot be fully modelled without prior knowledge;
above it, the PSF is over-sampled: the light is spread over more pixels than needed, which lowers the signal-to-noise ratio.
Depending on the kind of integral field spectrograph, this footprint on the detector is connected to the actual optical PSF of the telescope (slicer) or not (micro-lens array).
For a slicer#
In a slicer, the optical PSF in the slicer plane is cut into sub-images (one per slice). Each
of these images is then dispersed in the direction perpendicular to the slice. In slicersim,
“x” (dim 0) is the direction across the slices, hence the dispersion direction, and “y”
(dim 1) is the direction along the slice.
Hence, for a slicer, the dispersion resolution affects:
the optical PSF along the “y” direction (i.e. the sub-image seen by the detector);
the line spread function along the “x” direction.
For a micro-lens array (MLA)#
For a lenslet array, the information on the optical PSF is essentially lost after the lenses, which focus each spatial element into a point in the disperser plane. This point is then dispersed on the detector, forming a 2D trace (a “spectrogram”).
Hence, for an MLA, the dispersion resolution affects:
the cross-dispersion profile along the “y” direction;
the line spread function along the “x” direction.
Change the dispersion resolution#
Let us access the Spectrograph object of a SN Ia target.
import slicersim
snia = slicersim.LazuliSupernova()
spectro = snia.simulation.spectrograph
spectro.dispersion_resolution # default value
2.3
Let us now set dispersion_resolution to 2 (Nyquist sampling).
Note that the wavelength binning lbda depends on this parameter: changing it
redefines lbda, to keep the same resolving power.
changed_entries = spectro.update(dispersion_resolution=2)
print(changed_entries)
['lbda', 'meta']
and get the “PSF cube”, i.e. the spatial PSF at each wavelength:
psf_nyquist = spectro.get_spatial_psf(profile="airy")
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
fig, ax = plt.subplots()
norm = colors.LogNorm()
# Let's show the slice the closest to 5000A
index_lbda_5000 = np.argmin((spectro.lbda-5000)**2)
ax.imshow(psf_nyquist[index_lbda_5000], norm=norm, origin="lower")
<matplotlib.image.AxesImage at 0x310354050>
Now let us assume a dispersion resolution of 2.5, i.e. an over-sampled PSF.
changed_entries = spectro.update(dispersion_resolution=2.5)
psf_oversampled = spectro.get_spatial_psf(profile="airy")
fig, (ax, axo) = plt.subplots(ncols=2, figsize=(7,4))
norm = colors.LogNorm()
# Let's show the slice closest to 5000 Å.
# Remark: this index is not the same for psf_oversampled and psf_nyquist,
# as dispersion_resolution also affects the wavelength binning (more bins when oversampled).
# Nyquist
ax.imshow(psf_nyquist[index_lbda_5000], norm=norm, origin="lower")
ax.set_title("dispersion_resolution=2")
# Oversampled
index_lbda_oversampled_5000 = np.argmin((spectro.lbda-5000)**2)
axo.imshow(psf_oversampled[index_lbda_oversampled_5000], norm=norm, origin="lower")
axo.set_title("dispersion_resolution=2.5")
Text(0.5, 1.0, 'dispersion_resolution=2.5')