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:

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.