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.


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.


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


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.


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.


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.


>>> import numpy as np
>>> from import fits
>>> from import get_readable_fileobj
>>> from pydl.photoop.image import sdss_psf_recon
>>> psfile = ('' +
...           '3366/objcs/3/')
>>> with get_readable_fileobj(psfile, encoding='binary') as psField:  
...     with as hdulist:
...         psf = sdss_psf_recon(hdulist[3].data, 500, 500)