BUGS · SEE_ALSO

## NAME

fitskypars - edit the sky fitting algorithm parameters

## USAGE

`fitskypars`

## PARAMETERS

- salgorithm = "centroid"
- The sky fitting algorithm to be employed. The sky fitting options are:
- constant
- Use a user supplied constant value
*skyvalue*for the sky. This algorithm is useful for measuring large resolved objects on flat backgrounds such as galaxies or commets.

- file
- Read sky values from a text file. This option is useful for importing user determined sky values into APPHOT.

- mean
- Compute the mean of the sky pixel distribution. This algorithm is useful for computing sky values in regions with few background counts.

- median
- Compute the median of the sky pixel distribution. This algorithm is a useful for computing sky values in regions with rapidly varying sky backgrounds and is a good alternative to "centroid".

- mode
- Compute the mode of the sky pixel distribution using the computed mean and median. This is the recommended algorithm for APPHOT users trying to measuring stellar objects in crowded stellar fields. Mode may not perform well in regions with rapidly varying sky backgrounds.

- centroid
- Compute the intensity-weighted mean or centroid of the sky pixel histogram. This is the algorithm recommended for most APPHOT users. It is reasonably robust in rapidly varying and crowded regions.

- gauss
- Fit a single Gaussian function to the sky pixel histogram using non-linear least-squares techniques.

- ofilter
- Compute the sky using the optimal filtering algorithm and a triangular weighting function and the histogram of the sky pixels.

- crosscor
- Compute the sky value using the cross-correlation function of the sky pixel histogram and a Gaussian noise function with a sigma equal to the computed sigma of the sky pixel distribution.

- histplot
- Mark the peak of the histogram of the sky pixels on a plot of the histogram. This algorithm is useful for making careful interactive sky measurements for a small number of objects in complicated regions or for checking the behavior of other sky algorithms.

- radplot
- Mark the sky value on a radial distribution plot of the sky pixels. This algorithm is useful for making careful interactive sky measurements for a small number of objects in complicated regions or for checking the behavior of other sky algorithms.

- annulus = 10.(scale units)
- The inner radius of the annular sky fitting region in units of the DATAPARS scale parameter.

- dannulus = 10.(scale units)
- The width of the annular sky fitting region in units of the DATAPARS scale parameter.

- skyvalue
- The constant for constant sky subtraction.

- smaxiter = 10
- The maximum number of iterations performed by the sky fitting algorithm.
*Smaxiter*is required by the "gauss" and "ofilter" sky fitting algorithms.

- sloclip = 0.(percent)
- The low-side clipping factor in percentage points of the total number of sky pixels.

- shiclip = 0.(percent)
- The high-side clipping factor in percentage points of the total number of sky pixels.

- snreject = 50
- The maximum number of pixel rejection cycles.

- sloject = 3.0
- The ksigma low-side clipping factor for the pixel rejection phase of the
sky fitting algorithm.
*sloreject*is in units of the computed sky sigma.

- shiject = 3.0
- The ksigma high-side clipping factor for the pixel rejection phase of the
sky fitting algorithm.
*shireject*is in units of the computed sky sigma.

- khist = 3.
- The ksigma clipping factor for computing the histogram of the sky pixels.
*Khist*is in units of the computed sky sigma. The computed histogram will be 2.0 * khist * sigma wide.

- binsize = 0.10
- The width of a single bin of the histogram of sky values.
*Binsize*is in units of the computed sky sigma.

- smooth = no
- Boxcar smooth the histogram before computing a sky value ?

- rgrow = 0.(scale units)
- The region growing radius for pixel rejection in the sky region, in units
of the DATAPARS
*scale*parameter. When a bad sky pixel is detected, all pixels within rgrow / scale will be rejected. If rgrow is 0.0 region growing is not performed.

- mksky = no
- Mark the sky annulus on the displayed image ?

## DESCRIPTION

The sky fitting algorithm parameters control the action of the sky fitting
algorithms. The default parameter settings should give reasonable results in
the majority of cases. Several of the sky fitting parameters scale with
image scale, *scale*
which is data dependent. *Scale*
is defined in
the DATAPARS parameter set.

Sky pixels in an annular region of inner radius *annulus / scale*
pixels
and a width of *dannulus / scale*
pixels are extracted from the IRAF image.
If the *scale*
parameter is defined in terms of the number of half-width
at half-maximum of the point spread function per pixel, then single values of
annulus and dannulus will work well for images with different seeing and
detector characteristics.

Pixels outside of the good data range specified by *datamin*
and
*datamax*
are rejected from the sky pixel distribution. After bad
data rejection *Ploclip*
and *phiclip*
percent pixels are rejected
from the low and high sides of the sorted pixel distribution before any
sky fitting is done.

Sky values are computed using the sky fitting algorithm specified by
*salgorithm*
. The default value is "centroid". If *salgorithm*
= "mean", "median" or "mode", the sky value is computed directly from the
array of sky pixels. The remaining sky fitting algorithms use the histogram
of the object sky pixels. The computed histogram is *khist*
* sigma wide
with a bin width of *binsize*
* sigma where sigma is the computed
standard deviation of the sky pixels for each object. If *smooth*
= yes,
boxcar smoothing is performed on the computed histogram before sky fitting.
The mode of the histogram is computed using, a non-linear least squares
fit to a Gaussian (salgorithm = "gauss"), optimal filtering of the histogram
(salgorithm = "ofilter"), computing the intensity weighted mean of the
histogram (salgorithm = "centroid"), or by cross-correlation techniques
(salgorithm = "crosscor").

Two interactive methods of fitting sky are also available. If *salgorithm*
is "radplot" or "histplot", the user must interactively set the value of the
sky using a radial profile or a histogram profile plot.

Pixels which deviate from the sky value by more than *kreject times the
computed sky sigma are rejected from the fit. If *
*rgrow*
> 0, pixels
within a radius of rgrow / scale of the rejected pixel are also rejected from
the fit. The rejection procedure iterates until no further pixels are rejected,
all pixels are rejected, or the maximum number of rejection cycles
*snreject*
iterations is reached.

## EXAMPLES

1. List the sky fitting parameters.

ap> lpar fitskypars

2. Edit the sky fitting parameters.

ap> fitskypars

3. Edit the FITSKYPARS parameters from within the PHOT task.

da> epar phot ... edit a few phot parameters ... move to the fitskypars parameter and type :e ... edit the fitskypars parameters and type :wq ... finish editing the phot parameters and type :wq

4. Save the current FITSKYPARS parameter set in a text file skynite1.par. This can also be done from inside a higher level task as in the above example.

da> fitskypars ... edit some parameters ... type ":w skynite1.par" from within epar

## TIME REQUIREMENTS

## BUGS

## SEE ALSO

radprof,fitsky,phot,wphot,polyphot