fitsky image
image
The list of images containing the sky regions to be fit.
coords =
The name of the text file(s) containing the coordinates of the objects to
be fit, one object per line with the x and y coordinates in the
columns one and two respectively. If coords is null (""), FITSKY 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 name of the cursor command file.
If coords is defined, FITSKY can read coordinate information
from either the image cursor or coords (interactive
mode), or read coordinates from coords or a cursor command file
(batch mode). The number of coordinate files must be 0, 1, or equal to
the number of input images.
output = default
The results file or directory. If output is "default", "dir$default",
or a directory specification then fitsky constructs an output
name of the form dir$root.extension.version, where dir
is the directory, root is the root of the image name, extension is
"sky" and version is the next available version number. If output
is null (""), then no output file is written. If output is defined, then
the number of output
files is either 1 or equal to the number of input images.
plotfile =
The name of the file containing radial profile plots for stars written
to the output file. If
plotfile is not equal to null then a radial profile plot is written to
plotfile every time a record is written to the output file.
datapars =
The name of the file containing the data dependent parameters.
If datapars is null ("") then the default parameter set
in the user's uparm directory is used.
The critical parameter sigma is located here.
fitskypars =
The name of the file containing the sky fitting algorithm parameters.
If fitskypars is null ("") then the default parameter set
in the user's uparm directory is used.
The critical parameters salgorithm, annulus, and dannulus
are located here.
interactive = yes
Interactive or batch mode.
radplots = no
If radplots is set to yes and fitsky is run in interactive mode then a radial
profile plot of the sky region 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 = no
Print messages on the terminal in non-interactive mode.
graphics = stdgraph
The default graphics device.
display = stdimage
The default image display device.
Display can to be set to "stdgraph" to enable FITSKY to work interactively
off a contour plot.
icommands =
The image display cursor.
gcommands =
The graphics cursor.
FITSKY computes accurate sky values for a set of objects in the IRAF image image, whose coordinates are listed in the text file coords or are marked on the terminal interactively with the image cursor, and writes the computed sky values to the text file output.
FITSKY can be run either interactively or in batch mode by setting the parameter interactive. In interactive mode starting x and y positions can either be read directly from the image cursor or read from the text file coords. The user can adjust the parameters of the fitting algorithm until a satisfactory parameter set is found, change objects interactively or query for the next object in the list, and finally fit the entire coordinate list with that set of parameters. In batch mode the estimated positions can be 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.
The following cursor commands are currently available.
Interactive Keystroke Commands ? Print help : Colon commands v Verify the critical parameters w Save the current parameters d Plot radial profile of current star i Interactively set parameters using current star f Fit sky for current star spbar Fit sky for current star, output results m Move to next star in coordinate list m Fit sky for next star in coordinate list, output results l Fit sky for remaining stars in coordinate list, output results e Print error messages r Rewind the coordinate list q Exit task Colon commands :show [data/sky] List the parameters :m [n] Move to the next [nth] star in coordinate list :n [n] Fit sky to next [nth] star in coordinate list, output results Colon Parameter Editing Commands # Image and file name 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 PSF (scale units) :emission [y/n] Emission feature (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] Exposure time (time units) :xairmass [value] Airmass value (number) :ifilter [string] Filter id string :otime [string] Time of observation (time units) # 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 (+/- sky sigma) :smooth [y/n] Lucy smooth the sky histogram :binsize [value] Resolution of sky histogram (sky sigma) :smaxiter [value] Maximum number of iterations :sloclip [value] Low side clipping factor (percent) :shiclip [value] High side clipping factor (percent) :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) # Marking and plotting parameters :mksky [y/n] Mark sky annuli on the display :radplot [y/n] Plot radial profile of sky pixels The following commands are available from within the interactive setup menu. Interactive Fitsky Setup Menu v Mark and verify the critical parameters (a,d,s) s Mark and verify the standard deviation of the sky l Mark and verify the minimum good data value u Mark and verify the maximum good data value 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
A brief description of the data dependent parameters and the sky fitting parameters can be found in the online manual pages for the DATAPARS and FITSKYPARS tasks. A full description of the algorithms can be found in the document Specifications for the Apphot Package.
In interactive mode the following quantities are printed on the standard output as each object is measured.
image xinit yinit msky stdev sskew nsky nsrej 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 msky stdev sskew nsky nsrej sier error
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. Sier and error are the error code and accompanying error message respectively. Xinit and yinit are the center coordinates of the sky annulus in pixels. Msky, stdev and sskew are the sky value, standard deviation and skew respectively. Nsky and nsrej are the number of sky pixels used and the number of sky pixels rejected respectively.
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 parameters are non-physical
1. Compute the sky statistics 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 a radial profile plot.
ap> set stdimcur = stdimage ... define the image cursor ap> display n4147 1 fi+ ... display the image ap> fitsky n4147 ... type ? for an optional help page ... move the image cursor to a star ... type i to enter the interactive setup menu ... enter maximum radius in pixels of the radial profile ... set the annulus, dannulus, and sigma using the graphics cursor and the stellar radial profile plot ... typingleaves 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 ... move the image cursor to the stars of interest and tap the space bar ... the output will appear in n4147.sky.1
2. Compute the sky statistics for a few stars in M92 using a 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> fitsky m92 display=stdgraph ... type ? for 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 annulus, dannulus, and sigma using the graphics cursor and the stellar radial profile plot ... typingleaves everything at the default value ... type the w key to save the parameters in the parameter files ... type the v key to verify the 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 sky statistics will appear on the standard output for each star measured ... full output will appear in the text file m92.sky.1
3. Setup and run FITSKY 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 ... the output will appear in the text file m92.coo.1 ap> fitsky m92 coords=m92.coo.1 display=stdgraph ... type ? for an optional help menu ... type :.read m92.plot2 to read in the contour plot ... move the graphics cursor to the stars and tap space bar or ... use m, :m and/or n, :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.sky.2 ...
4. Run FITSKY in batch mode using the coordinate file and the previously saved parameters. Verify the critical parameters.
ap> fitsky m92 coords=m92.coo.1 verify+ inter- ... output will appear in m92.sky.3
5. Run FITSKY 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. Remember to turn the verify switch off in that case.
ap> fitsky m92 coords=m92.coo.1 inter- verify- ... output will appear in m92.sky.4
6. Run FITSKY interactively on the Sun workstation without the use of the IMTOOL window using only a coordinate list and the current set of parameters as input.
ap> set stdimcur = text ... set the image cursor to the standard input ap> fitsky m92 coords=m92.coo.2 ... type ? for optional help ... type :m 3 to set the initial coordinates to those of the third star in the list ... type i to enter the interactive setup menu followed by v to get the default menu ... enter maximum radius in pixels of the radial profile ... set the sigma, inner radius of the sky annulus, and the width of the sky annulus using the graphics cursor and the stellar radial profile plot ... typing.fiafter the prompt leaves the parameter at its 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.ctr.5
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.
datapars, fitskypars, phot, polyphot, radprof,