IRAF help page for package noao.digiphot.apphot, program wphot

from NOAO wphot -- perform weighted aperture photometry on a list of starsUSAGEPARAMETERSDESCRIPTIONCURSOR COMMANDSALGORITHMSOUTPUTERRORSEXAMPLESBUGSSEE ALSO

wphot -- perform weighted aperture photometry on a list of stars


USAGE

wphot image


PARAMETERS

image

The list of images containing the objects to be measured.

skyfile =

The name of the text file containing the sky values, of the measured objects, one object per line with x, y, the sky value, sky sigma and sky skew, the number of sky pixels, and the number of rejected pixels in columns one to seven respectively. This parameter is only requested if fitskypars.salgorithm = "file" and if WPHOT is run in batch.

coords =

The name of the text files containing the initial coordinates of the objects to be measured, one object per line with the x and y coordinates in columns one and two respectively. If coords is null (""), WPHOT will either read commands from the image cursor (default) or read commands from a cursor command file. In the latter case the image cursor parameter icommands must be set to the cursor command file. If coords is defined, WPHOT reads the coordinates from either the image cursor or the coordinate list (interactive mode), or read coordinates from the coordinate list or a cursor command file if any (batch mode). The number of coordinate files must either be 0, 1 or equal to the number of image files.

output = default

The name of the results file or results directory. If output is "default", "dir$default", or a directory specification then an output name of the form dir$root.extension.version is constructed, where dir is the directory, root is the root image name, extension is "omag" and version is the next available version of the file. If output is null (""), then no output file is written. The number of output files must be either 1 or equal to the number of image files.

plotfile =

The name of the file containing radial plots for the stars written to the output file. If plotfile is not equal to null then a single radial plot is written to plotfile for every record written to output.

datapars =

The name of the text file containing the data dependent parameters. If datapars is null ("") the default parameter set in the user's uparm directory is used. The critical parameters fwhmpsf, and sigma are located here.

centerpars =

The name of the text file containing the centering parameters. If centerpars is null ("") the default parameter set in the user's uparm directory is used. The critical parameters calgorithm and cbox are located here.

fitskypars =

The name of the text file containing the sky fitting parameters. If fitsky is null ("") the default parameter set in the user's uparm directory is used. The critical parameters salgorithm, annulus and dannulus are located here.

photpars =

The name of the text file containing the photometry parameters. If photpars is null ("") the default parameter set in the user's uparm directory is used. The critical parameters weighting and apertures are located here.

interactive = yes

Interactive or batch mode.

radplots = no

If radplots is yes and phot is run in interactive mode then a radial profile of each measured star is plotted on stdgraph.

verify = yes

Verify the critical parameters in non-interactive mode.

update = no

Update the critical parameters in non-interactive mode if verify is yes.

verbose = yes

Print messages on the terminal about actions taken in non-interactive mode.

graphics = stdgraph

The default graphics device.

display = stdimage

The default display device. Display can be set to "stdgraph" if WPHOT is to be run interactively from a contour plot.

commands =

The image cursor.

cursor =

The graphics cursor.


DESCRIPTION

WPHOT computes accurate centers, sky values, and weighted magnitudes for a list of objects in the IRAF image image whose coordinates are listed in the text file coords, or are marked on the image display interactively with the image cursor, and writes the computed x and y coordinates, sky values and magnitudes to the text file output.

In interactive mode the user may either define the list of objects interactively or create an object list prior to entering WPHOT. In either case the user may adjust the centering, sky fitting and photometry parameters until a satisfactory fit is achieved and only then store the final results in output. In batch mode the initial positions are read from the text file coords or the image cursor parameter icommands can be redirected to a text file containing a list of cursor commands.


CURSOR COMMANDS

The following list of cursor commands are currently available.

	Interactive Photometry Commands
?	Print help
:	Colon commands
v	Verify the critical parameters
w	Store the current parameters
d	Plot radial profile of current star 
i	Interactively set parameters using current star
c	Fit center of current star
t	Fit sky around the cursor
a       Average sky values fit around several cursor positions
s	Fit sky around the current star
p	Do photometry for current star, using current sky
o	Do photometry for current star, using current sky, output results
f	Do photometry for current star
spbar	Do photometry for current star, output results
m	Move to next star in coordinate list
n	Do photometry for next star in coordinate list, output results
l	Do photometry for remaining stars in coordinate list, output results
r	Rewind the coordinate list
e	Print error messages
q	Exit task
	Colon Commands
:show	[data/center/sky/fit]	Show parameters
:m [n]	Move to next [nth] star in the coordinate list
:n [n]	Do photometry for next [nth] star in coordinate list, output results
	Colon Parameter Editing Commands
# Image and file parameters
:image		[string]	Image name
:coords		[string]	Coordinate file name
:output		[string]	Output file name
# Data dependent parameters
:scale		[value]		Image scale (units per pixel)
:fwhmpsf	[value]		Full-width half-maximum of PSF (scale units)
:emission	[y/n]		Emission features (y), absorption (n)
:sigma	        [value]		Standard deviation of sky (counts)
:datamin	[value]		Minimum good pixel value (counts)
:datamax	[value]		Maximum good pixel value (counts)
# Noise parameters
:noise		[string]	Noise model (constant|poisson)
:gain		[string]	Gain image header keyword
:ccdread	[string]	Readout noise image header keyword
:epadu		[value]		Gain (electrons  per adu)
:readnoise	[value]		Readout noise (electrons)
# Observations parameters
:exposure	[string]	Exposure time image header keyword
:airmass	[string]	Airmass image header keyword
:filter		[string]	Filter image header keyword
:obstime	[string]	Time of observation image header keyword
:itime 		[value]		Integration time (time units)
:xairmass	[value]		Airmass value (number)
:ifilter	[string]	Filter id string
:otime		[string]	Time of observations (time units)
# Centering algorithm parameters
:calgorithm	[string]	Centering algorithm
:cbox		[value]		Width of the centering box (scale units)
:cthreshold	[value]		Centering intensity threshold (sigma)
:cmaxiter	[value]		Maximum number of iterations
:maxshift	[value]		Maximum center shift (scale units)
:minsnratio	[value]		Minimum S/N ratio for centering
:clean		[y/n]		Clean subraster before centering
:rclean		[value]		Cleaning radius (scale units)
:rclip		[value]		Clipping radius (scale units)
:kclean		[value]		Clean K-sigma rejection limit (sigma)
# Sky fitting algorithm parameters
:salgorithm	[string]	Sky fitting algorithm
:skyvalue	[value]		User supplied sky value (counts)
:annulus	[value]		Inner radius of sky annulus (scale units)
:dannulus	[value]		Width of sky annulus (scale units)
:khist		[value]		Sky histogram extent (+/- sigma)
:binsize	[value]		Resolution of sky histogram (sigma)
:smooth		[y/n]		Lucy smooth the sky histogram
:sloclip	[value]		Low-side clipping factor in percent
:shiclip	[value]		High-side clipping factor in percent
:smaxiter	[value]		Maximum number of iterations
:snreject	[value]		Maximum number of rejection cycles
:sloreject	[value]		Low-side pixel rejection limits (sky sigma)
:shireject	[value]		High-side pixel rejection limits (sky sigma)
:rgrow		[value]		Region growing radius (scale units)
# Photometry parameters
:weighting	[string]	Weighting function (constant|cone|gauss)
:apertures	[string]	List of aperture radii (scale units)
:zmag		[value]		Zero point of magnitude scale
# Plotting and marking parameters
:mkcenter	[y/n]		Mark computed centers on display
:mksky		[y/n]		Mark the sky annuli on the display
:mkapert	[y/n]		Mark apertures on the display
:radplot	[y/n]		Plot radial profile of object
The following commands are available from inside the interactive setup menu.
                    Interactive Phot/Wphot Setup Menu
	v	Mark and verify the critical parameters (f,s,c,a,d,r)
	f	Mark and verify the full-width half-maximum of psf
	s	Mark and verify the standard deviation of the background
	l	Mark and verify the minimum good data value
	u	Mark and verify the maximum good data value
	c	Mark and verify the centering box width
	n	Mark and verify the cleaning radius
	p	Mark and verify the clipping radius
	a	Mark and verify the inner radius of the sky annulus
	d	Mark and verify the width of the sky annulus
	g	Mark and verify the region growing radius
	r	Mark and verify the aperture radii


ALGORITHMS

WPHOT computes accurate centers for each object using the centering parameters defined in the CENTERPARS task, computes an accurate sky value for each object using the sky fitting parameters defined in FITSKYPARS task, and computes magnitudes using the photometry parameters defined in the PHOTPARS task. The noise characteristics of the data are defined in the DATAPARS task.

Three weighting functions are currently available: constant, cone and gauss. Constant weighting, the default, gives identical results to the PHOT task. Pixels are weighted by the fraction of their area inside the circular aperture. For cone and gauss weighting an additional triangular or gaussian weighting function of full width half maximum equal to fwhmpsf is applied to the pixels before aperture summing.

This task is currently experimental. Further algorithm work is to be expected.


OUTPUT

In interactive mode the following quantities are printed on the standard output as each object is measured. Error is a simple string which indicates whether the task encountered any errors in the the centering algorithm, the sky fitting algorithm or the photometry algorithm. Mag and merr are the magnitudes and errors in apertures 1 through N respectively and xcenter, ycenter and msky are the x and y centers and the sky value respectively.

    image  xcenter  ycenter  msky  mag[1 ... N]   error

In both interactive and batch mode full output is written to the text file output. At the beginning of each file is a header listing the current values of the parameters when the first stellar record was written. These parameters can be subsequently altered. For each star measured the following record is written

	image  xinit  yinit  id  coords  lid
	   xcenter  ycenter  xshift  yshift  xerr  yerr  cier error
	   msky  stdev  sskew  nsky  nsrej  sier  serror
	   itime  xairmass  ifilter otime
	   rapert  sum  area  mag  merr  pier  perr

Image and coords are the name of the image and coordinate file respectively. Id and lid are the sequence numbers of stars in the output and coordinate files respectively. Cier and cerror are the error code and accompanying error message respectively. Xinit, yinit, xcenter, ycenter, xshift, yshift, and xerr, yerr are self explanatory and output in pixel units. The sense of the xshift and yshift definitions is the following.

	xshift = xcenter - xinit
	yshift = ycenter - yinit

Sier and serror are the sky computation error code and accompanying error message respectively. Msky, stdev and sskew are the sky value (per pixel), standard deviation and skew respectively. Nsky and nsrej are the number of sky pixels and the number of sky pixels rejected respectively.

Itime is the exposure time, xairmass is self-evident, ifilter is an id string identifying the filter used during the observation, and otime is a string specifying the time of the observation in whatever units the user has defined.

Rapert, sum, and area are the radius of the aperture in pixels, the total number of counts including sky in the aperture and the area of the aperture in square pixels. Mag and merr are the magnitude and error in the magnitude in the aperture (see below).

        flux = sum - area * msky
         mag = zmag - 2.5 * log10 (flux) + 2.5 * log10 (itime)
        merr = 1.0857 * err / flux
         err = sqrt (flux / epadu + area * stdev**2 +
               area**2 * stdev**2 / nsky)

Pier and perror are photometry error code and accompanying error message.


ERRORS

If the object centering was error free then the field cier will be zero. Non-zero values of cier flag the following error conditions.

	0        # No error
	101      # The centering box is off image
	102      # The centering box is partially off the image
	103      # The S/N ratio is low in the centering box
	104      # There are two few points for a good fit
	105      # The x or y center fit is singular
	106      # The x or y center fit did not converge
	107      # The x or y center shift is greater than maxshift
	108      # There is bad data in the centering box

If all goes well during the sky fitting process then the error code sier will be 0. Non-zero values of sier flag the following error conditions.

	0         # No error
	201       # There are no sky pixels in the sky annulus
	202       # Sky annulus is partially off the image
	203       # The histogram of sky pixels has no width
	204       # The histogram of sky pixels is flat or concave
	205       # There are too few points for a good sky fit
	206       # The sky fit is singular
	207       # The sky fit did not converge
	208       # The graphics stream is undefined
	209       # The file of sky values does not exist
	210       # The sky file is at EOF
	211       # Cannot read the sky value correctly
	212       # The best fit parameter are non-physical

If no error occurs during the measurement of the magnitudes then pier is 0. Non-zero values of pier flag the following error conditins.

	0        # No error
	301      # The aperture is off the image
	302      # The aperture is partially off the image
	303      # The sky value is undefined
	305      # There is bad data in the aperture


EXAMPLES

1. Compute the weighted magnitdues for a few stars in N4147 using the display and the image cursor. Setup the task parameters using the interactive setup menu defined by the i key command and the radial profile plot.

	ap> set stdimcur = stdimage
	... define the image cursor
	ap> display n4147 1 fi+
	... display the image
	ap> wphot n4147
	... type ? to print an optional help page
	... move display cursor to a star
	... type i to enter the interactive setup menu
	... enter maximum radius in pixels of the radial profile
	... set the fwhmpsf, centering radius, inner and outer sky annuli,
	    apertures, sigma, and threshold using the graphics cursor and the
            stellar radial profile plot
	... typing  leaves everything at the default value
	... type the w key to save the parameters in the parameter files
	... type the v key to verify critical parameters
	... retype :.read m92.plot1 to reload the contour plot
	... move the image cursor to the stars of interest and tap
	    the space bar
	... a one line summary of the fitted parameters will appear on the
	    standard output for each star measured
	... the output appears in n4147.omag.1

2. Compute the weighted magnitdues for a few stars in M92 using the contour plot and the graphics cursor. Setup the task parameters using the interactive setup menu defined by the i key command.

	ap> set stdimcur = stdgraph
	... define the image cursor to be the graphics cursor
	ap> contour m92 >G m92.plot1
	... store the contour plot of m92 in the file m92.plot
	ap> wphot m92
	... type ? to print an optional help page
	... type :.read m92.plot1 to load the contour plot on the screen
	... move graphics cursor to a star
	... type i to enter the interactive setup menu
	... enter maximum radius in pixels of the radial profile
	... set the fwhmpsf, centering radius, inner and outer sky annuli,
	    apertures, sigma, and threshold using the graphics cursor and the
            stellar radial profile plot
	... typing  leaves everything at the default value
	... type the w key to save the parameters in the parameter files
	... type the v key to verify the critical parameters
	... retype :.read m92.plot1 to reload the contour plot
	... move the graphics cursor to the stars of interest and tap
	    the space bar
	... a one line summary of the fitted parameters will appear on the
	    standard output for each star measured
	... full output will appear in the text file m92.omag.1 

3. Setup and run WPHOT interactively on a list of objects, using a contour plot as the image display and the parameters defined and saved in example 1.

	ap> set stdimcur = stdgraph
	... define the image cursor to be the graphics cursor
	ap> contour m92
	... adjust plot parameters until the contour plot is satisfactory
	ap> =gcur
	... enter cursor mode
	... type :.write m92.plot2 to save the plot in a metacode file
	... type any key to quit cursor mode
	ap> daofind m92
	... make a coordinate list by searching for objects with  the
	    fwhmpsf and threshold defined in example 1
	... the output will appear in the text file m92.coo.1
	ap> wphot m92 coords=m92.coo.1
	... type help to print an optional help page
	... type :.read m92.plot2 to read in the contour plot
	... move the graphics cursor to the stars and tap space bar
				or
	... use :m and/or :n, l, r commands to measure objects in the
	    coordinate list
	... a one line summary of results will appear on the standard output
	    for each star measured
	... the output will appear in m92.omag.2 ...

4. Run WPHOT in batch mode using the coordinate file and the previously saved parameters. Verify the critical parameters.

	ap> wphot m92 coords=m92.coo.1 inter- verify+
	... output will appear in m92.omag.3

5. Run WPHOT in batch mode using the coordinate file and the previously saved parameters. The task can be submitted to the background by appending an ampersand to the command line listed below.

	ap> wphot m92 coords=m92.coo.1 inter- verify+
	... output will appear in m92.wmag.4

6. Run WPHOT interactively on the sun workstation using the imtool window, a coordinate list and the current set of parameters.

	ap> set stdimcur = text
	... set the image cursor to the standard input
	ap> display m92 1
	... display the image in the imtool window and put the mouse
	    in the imtool window
	ap> wphot m92 coords=m92.coo.2
	... type help to print an optional help page
	... type :m 3 to set the coordinates to the third star
	    in the list
	... type i to enter the interactive setup menu
	... enter maximum radius in pixels of the radial profile
	... set the fwhmpsf, centering radius, inner and outer sky annulus,
	    apertures, sigma and threshold using the graphics cursor and
	    the stellar radial profile plot
	... typing  leaves everything at the default value
	... type r to rewind the coordinate list
	... type l to measure all the stars in the coordinate list
	... a one line summary of the answers will appear on the standard
	    output for each star measured
	... full output will appear in the text file m92.wmag.4 


BUGS

This task is experimental and will undergo changes in the future.

It is currently the responsibility of the user to make sure that the image displayed in the frame is the same as that specified by the image parameter.

Commands which draw to the image display are currently disabled. The TVMARK task in the proto package can be used to draw simple marks on the display. All the APPHOT marking commands will however function if a contour plot is used in lieu of the image display.

Users should not be confused by the normally enabled markcur option in the SUN/IMTOOL setup window. This feature is under the control of the IMTOOL window and the APPHOT package has no control over it.


SEE ALSO

datapars, centerpars, fitskypars, photpars, phot, polyphot,


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