This PR fixes a problem with the GaussHermite PSF first noticed in desihub/desispec#340 : the PSFs are not necessarily centered within the spots: they are centered between 0 and 1 pixels above center rather than within +/-0.5 pixels of center. This could induce small edge effects if the PSF wings leak off the edge of the spot.
Original centering and differences in extraction with large vs. small spots; note that the spots tend to be up and to the right of the center pixel:
After centering fix:
A new unit test was also added to ensure that the center-of-mass of the PSF is within the central pixel as the PSF is scanned in wavelength.
Note: this fix is only for the GaussHermite format output by specex. It is possible that other PSF formats have non-optimal centering; that is not addressed here.
This PR fixes a problem with the GaussHermite PSF first noticed in desihub/desispec#340 : the PSFs are not necessarily centered within the spots: they are centered between 0 and 1 pixels above center rather than within +/-0.5 pixels of center. This could induce small edge effects if the PSF wings leak off the edge of the spot.
Original centering and differences in extraction with large vs. small spots; note that the spots tend to be up and to the right of the center pixel:
After centering fix:
A new unit test was also added to ensure that the center-of-mass of the PSF is within the central pixel as the PSF is scanned in wavelength.
Note: this fix is only for the GaussHermite format output by specex. It is possible that other PSF formats have non-optimal centering; that is not addressed here.