This notebook assumes that we are using an older style psf (for example, psf.fits which is included in this repo) and does not fully support using a newer psf (/global/cscratch1/sd/stephey/desitest/data/psfnight-r0.fits, for example). We should probably add some kind of
if old_psf:
do one thing
else:
do another thing
while we are loading the data to ensure psf compatibility.
In eval_coeffs, there are no issues reading 'X' and 'Y' from the old psf. In the new psf, we must add some mechanism for reading 'X' and 'Y'. For now I borrowed from gausshermite (https://github.com/desihub/specter/blob/master/py/specter/psf/gausshermite.py#L76) and added in some additional logic (which may or may not be right):
#and for X and Y do what gausshermite does
from astropy.io import fits
fx = fits.open('/global/cscratch1/sd/stephey/desitest/data/psfnight-r0.fits', memmap=False)
data = fx['PSF'].data
p['X'] = fx["XTRACE"].data
p['Y'] = fx["YTRACE"].data
Finally, the way I am storing 'X' and 'Y' may be contributing to this last issue, which is a dimension mismatch in calc_pgh on line:
This notebook assumes that we are using an older style psf (for example,
psf.fits
which is included in this repo) and does not fully support using a newer psf (/global/cscratch1/sd/stephey/desitest/data/psfnight-r0.fits
, for example). We should probably add some kind ofwhile we are loading the data to ensure psf compatibility.
In
eval_coeffs
, the line:must be changed to
for the new psf.
In
eval_coeffs
, there are no issues reading 'X' and 'Y' from the old psf. In the new psf, we must add some mechanism for reading 'X' and 'Y'. For now I borrowed from gausshermite (https://github.com/desihub/specter/blob/master/py/specter/psf/gausshermite.py#L76) and added in some additional logic (which may or may not be right):Finally, the way I am storing 'X' and 'Y' may be contributing to this last issue, which is a dimension mismatch in
calc_pgh
on line: