functional form of gaussian in DAOPHOT/psf
ameisner wrote on Oct 10, 2008
When I make a psf with a gaussian core in DAOPHOT/psf, it gives me the following parameters: X, Y, Height, Psfmag, Par1 and Par2. However, I can't find what the functional form is in terms of these parameters in any of the documentation. I imagine it's something like:
counts(x,y) = Height*exp{-[(x - X)^2]/2*(Par1)^2 - [(y - Y)^2]/2*(Par2)^2}
But I have no way of knowing with certainty the correspondence between X/Y, Par1/Par2 and horizontal/vertical directions or for that matter the units of X, Y, Par1, Par2. I'm guessing this info. is in the documentation somewhere but I can't seem to find it. Thanks.
counts(x,y) = Height*exp{-[(x - X)^2]/2*(Par1)^2 - [(y - Y)^2]/2*(Par2)^2}
But I have no way of knowing with certainty the correspondence between X/Y, Par1/Par2 and horizontal/vertical directions or for that matter the units of X, Y, Par1, Par2. I'm guessing this info. is in the documentation somewhere but I can't seem to find it. Thanks.
Mike Fitzpatrick wrote on Oct 10, 2008
The best documentation is of course the source code. From daophot$daolib/profile.x we find:
Where the daoerf() function is in the erf.x file in the same directory, the comments for which describe it as:
Hope this helps.
-Mike
# Compute the analytic part of the profile for a given x and y.
switch (ipstyp) {
# Evaluate the Gaussian function
# f = erfx * erfy / (par[1] * par[2])
# par[1] is the hwhm in x; sigma(x) = 0.8493218 * hwhm
# par[2] is the hwhm in y; sigma(y) = 0.8493218 * hwhm
case FCTN_GAUSS:
p1p2 = par[1] * par[2]
erfx = daoerf (dx, 0.0, par[1], dhdxc, dhdsx)
erfy = daoerf (dy, 0.0, par[2], dhdyc, dhdsy)
profile = erfx * erfy / p1p2
dhdxc = dhdxc * erfy / p1p2
dhdyc = dhdyc * erfx / p1p2
if (ideriv > 0) {
term[1] = (dhdsx - erfx / par[1]) * erfy / p1p2
term[2] = (dhdsy - erfy / par[2]) * erfx / p1p2
}
Where the daoerf() function is in the erf.x file in the same directory, the comments for which describe it as:
# DAOERF -- Numerically integrate a Gaussian function from xin-0.5 to xin+0.5
# using 4 point Gauss-Legendre integration. Beta is the half-width at
# half-maximum which is equal to 1.17741 * sigma. The Gaussian function is
# shown below.
#
# erf = exp (-0.5 *((x - x0) / beta) ** 2))
#
# or
#
# erf = exp (-0.6931472 * [(x - xo) / beta] ** 2)
#
# Also provide the first derivative of the integral with respect to xo and beta.
Hope this helps.
-Mike
Last post on Oct 10, 2008