5.1.3. WFSS Image Simulation (Simulate())
Methodology
The current implementation will only simulate the signal from the sources, but includes the Poisson noise from the source(s), sky background, and dark current and Gaussian noise from the read noise. To create a noiseless WFSS image:
Load WFSS data and spectral sources as
WFSSCollection()andSourceCollection(), respectively.Tabulate each WFSS image with the tabulation module
For each WFSS image:
Initialize noiseless science as all zero: \(\tilde{S}_{x,y}=0\) for all WFSS image pixels \((x,y)\).
For each detector in the WFSS file:
For each source in the source collection:
For each direct imaging pixel \((x_d,y_d)\) in the source:
load the PDT from the
PDTFile()append to a list
multiply the fractional pixel \(a_{(x_d,y_d)\rightarrow(x,y)}\) area between the direct and WFSS image (and tabulated in the PDTs), wavelength-dependent flat-field \(F_{x,y}(\lambda)\), sensitivity curve \(T(\lambda)\), pixel-area map \(P_{x,y}\) (see more below), and the source spectrum \(f_{x_d,y_d}(\lambda)\) associated with this direct-image pixel:
\[s_{x,y,l} = a_{(x_d,y_d)\rightarrow(x,y)}\,\frac{I_{x_d,y_d}}{\sum\limits_{\mathbb{S}_i} I_{x_d,y_d}}\,F_{x,y}(\lambda)\,T(\lambda)\,f_{x_d,y_d}(\lambda)\, P_{x,y}\,\delta\lambda\]where \(I_{x_d,y_d}\) is the direct-image brightness, \(\mathbb{S}_i\) is the collection of direct-imaging pixels associated with this source (see source description), and \(\delta\lambda\) is the tabulation bandwidth.
decimate the list of PDTs over the wavelength index (\(l\))
sum this decimated list into the noiseless science image:
\[\tilde{S}_{x,y} \rightarrow \tilde{S}_{x,y} + s_{x,y}\]
To add noise to this noiseless image, slitlessutils requires two additional user-specified parameters Table 5.2, which must be set when loading the WFSSCollection(). See the discussion for the WFSS data for more details.
Keyword |
Unit |
Description |
|---|---|---|
Background |
\(\mathrm{e}^-/\mathrm{s}\) |
The notional background level, which is assumed to be constant across the
detector
|
Exposure time |
\(s\) |
The exposure time |
Now the expected total number of electrons will be \(E = \left(\tilde{S}_{x,y}+B+D\right)\times t\), which is used to draw random Poisson and normal deviates for each pixel:
where \(B\) and \(t\) are the background and exposure time described in Table 5.2, and \(D\) and \(R\) are the dark current and read noise (see the instrument tables). Now the final, noised-science \(S_{x,y}\) and uncertainty \(U_{x,y}\) rate images are then:
both in units of \(\mathrm{e}^-/\mathrm{s}\). The background rate and dark current are subtracted here to produce an image equivalent to a sky-subtracted WFSS image.
Important
Some detectors (e.g. WFC3/IR) record the images in \(\mathrm{e}^-/\mathrm{s}\), while others (e.g WFC3/UVIS, ACS/WFC, ACS/SBC) use \(e^-\). This information is encoded in the instrument-specific yaml files in $HOME/.slitlessutils/<VERSION>/instruments (but see also instrument tables), which will modify the definitions for the final, noised images \(S_{x,y}\) and \(U_{x,y}\).
Example
A full simulation is fairly involved, so please see the function slitlessutils.examples.starfield.py, specifically the functions slitlessutils.examples.starfield.simulate_grisms() and slitlessutils.examples.starfield.make_scene().
Additional Instrument Settings
There are many other parameters required to simulate a WFSS image, and these are stored in several yaml files in the configuration directory in $HOME/.slitlessutils/<VERSION>/instruments/. Modifying these files is highly discouraged.
Excluded Effects
The simulations provided by slitlessutils make several simplifying assumptions that will be reevaluated in future releases. In order of relative importance of their adverse effect on the expected signal-to-noise (S/N), these are:
The sky background is assumed to be a single value, however as discussed in the global sky belies this assumption. Employing a realistic global-sky image with a scale factor (\(\alpha\)) by modifying the source/uncertainty equations to have \(B\rightarrow \alpha\,B_{x,y}\), where \(\alpha\) becomes the tunable parameter to be set by the user. The current implementation will give the illusion of a constant S/N over the detector, but the deviations from constant will depend on the how adopted level compares to the (large-scale) variations in the global-sky image. Therefore this may introduce small systematic biases based on the position of the sources.
The DQA is assumed to have no bad pixels flagged, which effectively overestimates the number of valid science pixels and perhaps slightly the S/N.
The dark current and read noise are assumed to be a single values that applies uniformly to all pixels, yet real detectors may have pixel-to-pixel variations. Like the sky-background issue, this may introduce weak systematic, spatial biases.
The telescope attitude is set by the user and assumed to be noiseless, but in practice there are systematic uncertainties in the accuracy of the world-coordinate system (WCS). In general, errors in the WCS result in a systematic wavelength shift (sometimes called the wavelength zeropoint) and/or flux losses (akin to slit-losses in aperture spectroscopy). However Ryan, Casertano, & Pirzkal (2018) show that these effects are very small compared for most HST observations and negligible compared to the spectro-photometric noise.
An Aside on Pixel-Area Maps
The pixel-area map (PAM) describes the relative pixel size due to distortions in the detector, which is given by the absolute value of the determinant of the Jacobian matrix. In principle, the distortion can be described in many ways (e.g. look-up table), but slitlessutils currently assumes this will be described by Simple-Imaging Polynomials (SIP). In which case, the Jacobian is simply:
where all of these partial derivatives are (by definition) polynomials of \((x,y)\). Therefore, the PAM becomes:
Slitlessutils computes these values on-the-fly as needed.