sdss_psf_recon

pydl.photoop.image.sdss_psf_recon(psfield, xpos, ypos, normalize=None, trimdim=None)[source]

Reconstruct the PSF at position (xpos, ypos) in an SDSS field.

These can be read from the psField files.

Parameters
psfieldFITS_rec

A PSF KL-decomposition structure read from a psField file. This is from HDU’s 1 through 5 in a psField file, corresponding to the five filters u, g, r, i, z.

xposint

Column position (0-indexed, not 0.5-indexed as PHOTO outputs).

yposint

Row position (0-indexed, not 0.5-indexed as PHOTO outputs).

normalizeint or float, optional

If set, normalize the integral of the image to this value.

trimdimtuple, optional

Trimmed dimensions; for example, set to (25, 25) to trim the output PSF image to those dimensions. These dimensions must be odd-valued.

Returns
numpy.ndarray

The 2D reconstructed PSF image, typically dimensioned (51, 51). The center of the PSF is always the central pixel; this function will not apply any sub-pixel shifts.

Notes

The SDSS photo PSF is described as a set of eigen-templates, where the mix of these eigen-templates is a simple polynomial function with (x,y) position on the CCD. Typically, there are 4 such 51x51 pixel templates. The polynomial functions are typically quadratic in each dimension, with no cross-terms.

The formula is the following, where \(i\) is the index of row polynomial order, \(j\) is the index of column polynomial order, and \(k\) is the template index:

\[\begin{split}a_k &= \sum_i \sum_j (0.001 \times \mathrm{ROWC})^i \times (0.001 \times \mathrm{COLC})^j \times [C_k]_{ij} \\ \mathrm{psfimage} &= \sum_k a_k \mathrm{RROWS}_k\end{split}\]

The polynomial terms need not be of the same order for each template.

Examples

>>> import numpy as np
>>> from astropy.io import fits
>>> from astropy.utils.data import get_readable_fileobj
>>> from pydl.photoop.image import sdss_psf_recon
>>> psfile = ('https://data.sdss.org/sas/dr14/eboss/photo/redux/301/' +
...           '3366/objcs/3/psField-003366-3-0110.fit')
>>> with get_readable_fileobj(psfile, encoding='binary') as psField:  
...     with fits.open(psField) as hdulist:
...         psf = sdss_psf_recon(hdulist[3].data, 500, 500)