IRAF help page for package noao.digiphot.daophot, program peak

from NOAO peak -- fit the PSF to single starsUSAGEPARAMETERSDESCRIPTIONOUTPUTERRORSEXAMPLESTIME REQUIREMENTSBUGSSEE ALSO

peak -- fit the PSF to single stars


USAGE

peak image photfile psfimage peakfile rejfile


PARAMETERS

image

The list of images containing the stars to be fit.

photfile

The list of input photometry files, or the directory, containing initial estimates of the positions and magnitudes of the stars to be fit. If photfile is "default", "dir$default", or a directory specification, then PEAK will look for a file with the name image.mag.?, where ? is the highest existing version number. Otherwise photfile must specify one photometry file for each input image in image. Photfile is usually the output of the DAOPHOT PHOT task, but may also be the output of PEAK itself, or the DAOPHOT package GROUP, NSTAR, ALLSTAR or PSF tasks. Photfile may be an APPHOT/DAOPHOT text database or an STSDAS table.

psfimage

The list of images, or the directory, containing the PSF computed by the DAOPHOT PSF task. If psfimage is "default", "dir$default", or a directory specification, then PEAK will look for an image with the name image.psf.?, where ? is the highest existing version number. Otherwise psfimage must specify one PSF image for each image in image.

peakfile

The list of output photometry files. If peakfile is "default", "dir$default", or a directory specification, then PEAK will write an output file with the name image.pk.? where ? is the next available version number. Otherwise peakfile must specify one output file for each image in image. Peakfile is a text database if the DAOPHOT package parameter text is "yes", an STSDAS table database if it is "no".

rejfile

The list of output rejected photometry files. If rejfile is null (""), results for all the stars in photfile are written to peakfile, otherwise only the stars which were successfully fit are written to peakfile and the remainder are written to rejfile. If rejfile is "default", "dir$default", or a directory specification then PEAK will write an output file with the name image.prj.? where ? is the next available version number. Otherwise rejfile must specify one output photometry file for every image in image. Rejfile is a text database if the DAOPHOT package parameter text is "yes", an STSDAS table database if it is "no".

datapars =

The name of the file containing the DAOPHOT data dependent parameters. If datapars is null ("") then the default parameter set in the user's uparm directory is used.

daopars =

The name of the file containing the DAPHOT fitting parameters. If daopars is null ("") then the default parameter set in the user's uparm directory is used.

verbose = )_.verbose

Print messages about the progress of the task? Verbose may be set to the value of the daophot package parameter (the default), "yes", or "no".

verify = yes

Verify critical PEAK task parameters? Verify may be set to the value of the daophot package parameter (the default), "yes", or "no".

update = no

Update critical PEAK task parameters if verify = "yes"? Update may be set to the value of the daophot package parameter (the default), "yes", or "no".


DESCRIPTION

PEAK computes x and y centers, sky values and magnitudes for all the stars in photfile by fitting the PSF in psfimage to single stars in image. PEAK reads initial estimates of the centers and magnitudes along with the sky values from the photometry file photfile. Photfile is usually the output of the DAOPHOT PHOT task but may also be the output of PEAK itself, NSTAR, ALLSTAR, GROUP or PSF. The computed centers, sky values, and magnitudes are written to peakfile along with the number of iterations it took to fit the star, the goodness of fit statistic chi, and the image sharpness statistic sharp. If rejfile is not null (""), only stars that are successfully fit are written to peakfile, and the remainder are written to rejfile. Otherwise all the stars are written to peakfile. Peakfile and rejfile are text databases if the DAOPHOT package parameter text is "yes", an STSDAS table database if it is "no".

By default PEAK computes new centers for all the stars in photfile. However if the DAOPARS parameter recenter is "no", PEAK assumes that the x and y centers in photfile are the true centers and does not refit them. This option can be quite useful in cases where accurate center values have been derived from an image that has been through some non-linear image restoration algorithm, but the photometry must be derived from the original unrestored image.

By default PEAK uses the sky value in photfile. However if the DAOPARS parameter fitsky is "yes", then PEAK computes a new sky value as part of the non-linear least-squares fit. Recomputing the sky can significantly reduce the scatter in the magnitudes in regions where the sky background is varying rapidly, but users may need to increase fitrad to include more sky pixels in the fit. Users should experiment cautiously with this option.

Only pixels within the good data range delimited by the DATAPARS task parameters datamin and datamax are included in the fit. Most users set datamin and datamax so as to exclude pixels outside the linearity regime of the detector. By default all the data is fit. Users are advised to determine the values of these parameters for their detector and set the values in DATAPARS before beginning any DAOPHOT reductions.

Only pixels within the fitting radius set by the DAOPARS task parameter fitrad divided by the DATAPARS parameter scale are included in the fit. Since the non-linear least-squares fits determine three unknowns, the x and y position of the star's centroid and its brightness, the value of fitrad must be sufficiently large to include at least three pixels in the fit. To accelerate the convergence of the non-linear least-squares fitting algorithm, pixels within fitrad are assigned weights which are inversely proportional to the radial distance of the pixel from the x and y centroid of the star, falling from a maximum at the centroid to zero at the fitting radius. Fitrad must be sufficiently large to include at least three pixels with non-zero weights in the fit. Values of fitrad close to the full-width at half-maxima of the PSF are recommended.

PEAK performs a weighted fit to the PSF. The weight of each pixel is computed by combining the radial weighting function described above with weights derived from the expected random errors computed using the values of the DATAPARS parameters readnoise and epadu specified by the user. Both to obtain optimal fits, and because PEAK employs a conservative formula, dependent on readnoise and epadu, for reducing the weights of deviant pixels which do not approach the model as the fit proceeds, users are strongly advised to determine the values of these parameters accurately, and to enter these values in DATAPARS before beginning any DAOPHOT reductions.

For each star to be fit, PEAK extracts a subraster from image which is N by N pixels square where N is approximately 2 * psfrad / scale + 1 pixels wide. Psfrad is the PSF radius specified in the DAOPARS task and scale is the scale factor specified in the DATAPARS task. Psfrad may be less than or equal to, but can never exceed the value of the image header parameter "PSFRAD" in psfimage. Psfrad should be set to a value several pixels larger than fitrad in order to permit the x and y centroids to wander during the fitting process.

Along with the computed x and y centers and magnitudes, PEAK outputs the number of times the PSF fit had to be iterated to reach convergence for each star. The minimum number of iterations is three. The maximum number of iteration permitted is specified by the maxiter parameter in the DAOPARS task. Obviously the results for stars which have reached the maximum iteration count should be viewed with suspicion. However since the convergence criteria are quite strict, (the computed magnitude must change by less than .001 magnitudes or 0.05 sigma whichever is larger and the x and y centroids must change by less than 0.01 pixels from one iteration to the next), even these stars may be reasonably well measured.

PEAK computes a goodness of fit statistic chi which is essentially the ratio of the observed pixel-to-pixel scatter in the fit residuals to the expected scatter. Since the expected scatter is dependent on the DATAPARS task parameters readnoise and epadu, it is important for these values to be set correctly. A plot of chi versus magnitude should scatter around unity with little or no trend in chi with magnitude, except at the bright end where saturation effects may be present.

Finally PEAK computes the statistic sharp which estimates the intrinsic angular size of the measured object outside the atmosphere. Sharp is roughly defined as the difference between the square of the width of the object and the square of the width of PSF. Sharp has values close to zero for single stars, large positive values for blended doubles and partially resolved galaxies, and large negative values for cosmic rays and blemishes.

Because PEAK cannot fit stars in crowded fields with overlapped images like the NSTAR and ALLSTAR tasks do, and for sparsely populated frames aperture photometry produced by PHOT is often just as good and faster to compute, PEAK has few unique functions. PEAK is often useful however for fitting and removing single stars in images where the stars are interfering with the real object of interest such as a galaxy. In that case the PEAK results can be input to SUBSTAR which will then remove the interfering stars. Another potential use of PEAK is the removal of stars from sparsely populated sky flats in preparation for smoothing.


OUTPUT

If verbose = yes, a single line is output to the terminal for each star fit or rejected. Full output is written to allstarfile and rejfile. At the beginning of these two files a header listing the current values of the parameters is written. For each star fit/rejected the following quantities are written to the output file.

	id  xcenter  ycenter  mag  merr  msky  niter  sharpness  chi
	    pier  perr

Id is the id number of the star. Xcenter and ycenter are the fitted coordinates in pixels. Mag and merr are the fitted magnitude and magnitude error respectively. Msky is the individual sky value for the star. Niter is the number of iterations it took to fit the star and sharpness and chi are the sharpness and goodness of fit statistic respectively. Pier and perror are the photometry error code and accompanying error message respectively.


ERRORS

If no errors occur during the fitting process then pier is 0. Non-zero values of pier flag the following error conditions.

	0		# No error
	1		# The sky is undefined
	2		# There are too few good pixels to fit the star
	3		# The fit is singular
	4		# The star is too faint


EXAMPLES

1. Fit the PSF to a list of single stars which are interfering with the image of the galaxy M87. After the fit subtract the fitted stars from the image.

    da> peak m87 m87.mag.1 m87.psf.1 default default verb+ veri+
    da> substar m87 m87.pk.1 m87.psf.1 default veri-

2. Run peak exactly as in example 1 but submit the task to the background saving all the verbose output in a file called peak.out. Remember to turn off the verify switch. Note that in this example the user has decided to put the fitted and rejected stars in the same file.

    da> peak m87 m87.mag.1 m87.psf.1 default "" verb+ veri- > peak.out & 


TIME REQUIREMENTS


BUGS


SEE ALSO

datapars, daopars, nstar, allstar,


This page automatically generated from the iraf .hlp file. If you would like your local iraf package .hlp files converted into HTML please contact Dave Mills at NOAO.

dmills@noao.edu