Story
As a careful observer, I have taken my data at several different orientations with direct images as well. I would like to extract 1D spectra taking advantage of the observed morphology of the source in the direct image, and a first guess at its spectrum and that of the sources that may be overlapping.
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
- Goodness-of-fit
- Overall, and for each source individually
Computations
- Maps pixels in the direct image to x,y, wavelength
- Folds the model spectra through the instrument response
- for the target of interest and the contaminants
- for each orientation
- Fits the models to the data
- Somehow?
- How do we specify parameters to vary?
- What do we use as the merit-function for the fit?
- How do we weight the data?
- What do we use as the optimizer?
- How do we calculate uncertainties?
- Somehow?
- Accumulates some kind of contamination flag at each wavelength
Drawbacks
- Takes more effort and time than a spectral extraction based on a bounding box.
- Uncertainties depend more on the input assumptions (e.g. models for contaminating sources)
- This approach won't find isolated emission lines.