Story

Minimal: As a user I want to get a 2D grism spectrum extracted for inspection and for further modeling and analysis.

Better: In addition, produce diagnostic PNGs that show the individual spectra.

Inputs

Case A: A set of grism images (FLT/FLC) at different dither positions (same  PA, same visit)

Case B: Case A + also a set of grism images at a different position angles (different visits) of the same field.

A source RA, Dec

Outputs

A single multiextension FITS file which contains:

For each FLT:

  • 2D cutout from the SCI extension of the grism image of the +1st order spectrum. The y (spacial) size of the cutout should be scaled to the size of the object (Kron radius/flux radius) or specified by the user. The x (wavelenth) size of the cutout should span the wavelenth coverage of the grism. All cutouts at the same PA should generally have the same size. If the spectrum falls off the edge of the detector for one (or more) of the dither positions, the cutout should be padded to the same size. The header could contain the full FLT header with a corrected WCS.
  • 2D error array, a cutout of the same pixels in the error array
  • 2D DQ array, a cutout of the same pixels from the DQ array
  • 2D contamination model, a cutout of the same size with the co-added contributions of the contaminating sources
  • 1D trace array, the y position of the center of the trace for each x pixel in the 2D cutout
  • 1D wavelength array, the wavelength value at the edge/center of each pixel
  • A 2D direct image of the object, at the same PA as the grism image, either a cutout from the direct image or a blotted direct image
  • (Optional), a segmentation map cutout, blotted to the grism reference frame

So if there are 2 visits, with 4 FLT grism images each, this file should contain 2x4x8 extensions

Fitting in the FLT space is most robust as the grism dispersion is defined in the "FLT" coordinates and the model comparison is done directly on un-resampled image pixels with relatively well-understood noise properties.

Optional PNGs:

EXAMPLE FROM CLEAR?

Computations

Drawbacks

Users need to keep in mind the limitations of co-adding 2D and 1D grism images! In the general case, this procedure cannot be done correctly because the spacial AND the spectral coordinate cannot be simultaneously interpolated on the same grid for each spectrum. You can do just the spacial axis (see emission line maps) or the spectral (and smooth over the spacial variations) but not both. See the use case on co-adding for more discussion.


  • No labels