Issue JP-4348 was created on JIRA by Ned Molter:
The wavelength backplane to the virtual slits extracted for WFSS data in the Extract2dStep is wrong, and sometimes wrong to the point of being highly unreasonable. See the attached images.
The wavelength backplane is found by assuming that all direct-image flux is at the slit reference point, and then figuring out the wavelength value needed to disperse from the reference point into a given dispersed-plane pixel. This is wrong for two related reasons:
Multiple direct-image pixels at multiple different wavelengths contribute to a given dispersed pixel. This is true for point sources due to the PSF, and it’s even more true for extended sources.
For some bright sources with extended PSFs as well as some extended sources, there are dispersed-plane pixels where the real contribution from the reference point does not exist at all.
See the attached images. There is an extended source, with a large footprint in the segmentation map. (The multiple sources should be deblended, see JP-4339, but the present issue will remain an issue.) The file jw03362010001_15101_00006_slit0_wavelength_default.png shows the wavelength solution, with the colorbar being in microns. The cutout is ~800 pixels long in the dispersion direction, much longer than a single-pixel dispersion would be, and the wavelengths accordingly extend far beyond the ~0.8-1.0 um that would be expected in this filter. Some of the wavelengths even go negative.
Two possible solutions I see are:
- Force the wavelength backplane to be NaN outside the wavelengths defined in the WAVELENGTHRANGE file. This would make a slit cutout like this one have mostly NaN wavelengths. The 1-D spectral extraction would be constrained to within the expected range, but it would lose a lot of signal and fail to account for the fact that each dispersed pixel encodes multiple direct-image pixels/wavelengths.
- Use the wfss_contam step to compute the wavelengths expected to contribute in each dispersed pixel, and use those to override the wavelength backplane of the slit when wfss_contam is turned on. This could either be a 3rd dimension of the image containing multiple wavelengths and their associated weights at each dispersed pixel (in which case the algorithm of extract1d needs to be reconsidered), or it could be an average wavelength in each dispersed pixel (easier to implement as extract1d need not change, would still be inaccurate but perhaps better than the current state).
There may be other solutions. I'd love to hear thoughts from the WFSS experts.
Issue JP-4348 was created on JIRA by Ned Molter:
The wavelength backplane to the virtual slits extracted for WFSS data in the Extract2dStep is wrong, and sometimes wrong to the point of being highly unreasonable. See the attached images.
The wavelength backplane is found by assuming that all direct-image flux is at the slit reference point, and then figuring out the wavelength value needed to disperse from the reference point into a given dispersed-plane pixel. This is wrong for two related reasons:
Multiple direct-image pixels at multiple different wavelengths contribute to a given dispersed pixel. This is true for point sources due to the PSF, and it’s even more true for extended sources.
For some bright sources with extended PSFs as well as some extended sources, there are dispersed-plane pixels where the real contribution from the reference point does not exist at all.
See the attached images. There is an extended source, with a large footprint in the segmentation map. (The multiple sources should be deblended, see JP-4339, but the present issue will remain an issue.) The file
jw03362010001_15101_00006_slit0_wavelength_default.pngshows the wavelength solution, with the colorbar being in microns. The cutout is ~800 pixels long in the dispersion direction, much longer than a single-pixel dispersion would be, and the wavelengths accordingly extend far beyond the ~0.8-1.0 um that would be expected in this filter. Some of the wavelengths even go negative.Two possible solutions I see are:
There may be other solutions. I'd love to hear thoughts from the WFSS experts.