desihub / specter

A toolkit for simulating multi-object spectrographs
Other
8 stars 7 forks source link

fix GH PSF spot centering #47

Closed sbailey closed 7 years ago

sbailey commented 7 years ago

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:

extract-ringing-spots

After centering fix:

extract-ringing-spots

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.

julienguy commented 7 years ago

checked this improves spectral precision by ~3%.