Right now, the extraction aperture has a fixed width and does not move with time. This could be modified in the following ways:
the width of the aperture varies with wavelength or the mean flux of the spectrum in the master image, while still using boxcar apertures. This would allow a slightly better optimization for targets with big dynamic range, ranging from faint to bright across wavelengths (for example, M dwarfs).
optimal extraction, that uses an extraction aperture weighted in the cross-dispersion direction by the ratio of target-to-sky flux. This would be an objective way to optimize the extraction, but will depend on modeling the [wavelength and time]-dependent cross-dispersion profile somewhat accurately.
For both of these options, the extraction apertures would like need to move with time. This isn't too bad in that we already effectively fit for a trace polynomial at each exposure; the aperture would just need to recenter on this time-dependent polynomial, instead of one that is fixed in time.
The extraction happens in Aperture.py, and the original definition of the extraction masks happens in Trace.py. (The links point to line numbers that are most relevant.)
Right now, the extraction aperture has a fixed width and does not move with time. This could be modified in the following ways:
For both of these options, the extraction apertures would like need to move with time. This isn't too bad in that we already effectively fit for a trace polynomial at each exposure; the aperture would just need to recenter on this time-dependent polynomial, instead of one that is fixed in time.
The extraction happens in Aperture.py, and the original definition of the extraction masks happens in Trace.py. (The links point to line numbers that are most relevant.)