Story
As an impatient astronomer, I just want to extract a 1D spectrum for a single source given perfectly registered images and assuming calibrations are correct. I want it fast and I don't want to think about forward modeling.
Inputs
- Direct and slitless images with perfect WCSs
- catalog information (coordinates, magnitudes ...)
- Exposure times?
- Noise model? Or components of the noise model (gain, exptime, read noise, subtracted background)?
- Or is this already in an uncertainty array?
- Detector signatures already removed (e.g. CALWEBB_DETECTOR1)
- Identification of the pixels in the direct image corresponding to "the source" (e.g. from a segmentation map)
- Identification of any pixels in the direct image corresponding to contaminating sources
Outputs
- A 1D extracted spectrum in a format that can be used by specutils
- Flux vs. wavelength
- Uncertainties
- Propagated data-quality flags
- Flags of the pixels that are contaminated by other sources; IDs of the contaminating sources
Computations
- Maps pixels in the direct image to x,y, wavelength
- Accumulates the flux at each wavelength (onto some wavelength grid)
- Perhaps weighted by the flux in the direct image at this cross-dispersion location
- Accumulates uncertainties at each wavelength
- Accumulates some kind of contamination flag at each wavelength
- As a quick & dirty story, this could be as simple as looking at overlapping bounding boxes
- Probably best to record the IDs of the contaminating sources
Drawbacks
- This doesn't do much to address contamination
- This mixes together wavelength and position more than a forward-modeling approach.
- Uncertainties are likely to be quite misleading