View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

question about PSF residuals in DAOPHOT

ameisner wrote on Nov 23, 2008

When I make a PSF with one look-up table of residuals using DAOPHOT/psf, the output psf image has a table of residuals and its header stores a magnitude PSFMAG. Presumably, in tasks such as DAOPHOT/peak this information is sufficient for the fitting algorithm to reconstruct a "composite" psf from the analytic function + residuals. However, I can't find any portion of the documentation that states in what proportions the analytic function and residuals are combined to form the composite psf image. For example, is PSFMAG the analytic core magnitude to which the look-up table should be added with no scaling (there are a number of other similar conceivable ways to use PSFMAG to try to figure out the relative weights of residuals/analytic part). Furthermore, are the residuals and analytic part even fixed relative to each other in the composite psf, or do tasks like peak and nstar treat their magnitudes as separate parameters when fitting? I have tried different relative weights of the analytic part + residuals to try to match the output of seepsf which should essentially be making a sample "composite" psf but I haven't been able to come to a satisfactory conclusion. I am interested in this because I'd like to take the psf from DAOPHOT and reproduce it for use in other computations outside IRAF. Thanks for any help.

Francisco Valdes wrote on Nov 23, 2008

I believe the way this works is that the analytic and residuals are simply added together such that there is no relative scale difference between the two. Another way to say this is that the the keyword PSFHEIGH and the residuals are on the same scale. The purpose of PSFMAG is as a zero point to relate image counts and magnitudes from the input photometry. For instance, a magnitude of a star fit to the PSF is PSFMAG - 2.5 log10(x) where x is the fit of the PSF to an image star in the image data units.

Caveat: I did not develop this code, I am not a photometrist, and I've not used this for science.

ameisner wrote on Nov 23, 2008

Playing around with some of my PSF's a bit I managed to confirm that you are correct about the fact that residuals are not scaled between the psf model and seepsf output; outside the PSF core (several standard deviations of the analytic function from the PSF center) the analytic portion makes a negligible contribution to the value of a given pixel, and when I reduce the original psf residuals in size using nearest neighbor interpolation I get precise agreement between pixel values I calculate and those found in the seepsf output. From there, I can calculate the scaling of the analytic portion, and adding an appropriately scaled analytic portion on top of the unscaled residuals, I get essentially a perfect reproduction of the seepsf output. The strange thing is that I still can't figure out what PSFHEIGH means, which is sort of bothering me. From what you said earlier I expected PSFHEIGH to be defined as something like:

analytic_counts(x,y) = PSFHEIGH*exp(-x^2/(2*sigma_x^2)-y^2/(2*sigma_y^2))

However, I've found that this is not the case. Could you clarify what you believe PSFHEIGH to be? Is it the counts from the analytic portion within some particular aperture radius? Thanks again.

Francisco Valdes wrote on Nov 23, 2008

The code shows that the analytic profile is computed and then multiplied by HEIGHT and then the residuals are added. The model is then scaled by the "relative brightness" to match a particular star or create an artificial star. I think this basically agrees with your equation though the function need not be your exponential. Also for a Gaussian there is an integration over the width of a pixel rather than just evaluating at the center of a pixel.

Frank

Last post on Nov 23, 2008