makemask: Make an object mask for a single image

Package: xdimsum

Usage

makemask inlist outlist

Parameters

inlist
The list of input images for which object masks are to be created.
outlist
The list of output masks. The number output masks must be the same as the number of input images. list of output masks. The number output masks must be the same as the number of input images.
hinlist = ""
The list of images to which BPM keywords containing the name of the output maks are to be added. Hinlist may be the same as or different from inlist.
subsample = 1
The block averaging factor applied to the input image before median filtering.
checklimits = yes
Check the input image data limits for the fast median filter ? If checklimits is yes then the lower and upper data limits are set to max (zmin, image_min) and min (zmax, image_max) respectively. If checklimits is no no image data limits checking is done.
zmin = -32767, zmax = 32767
The default data limits supplied to the fast median filter if checklimits is yes.
filtsize = 15
The size of the fast median filter used to determine the background. The effective size of the median filter is subsample * filtsize.
nsmooth = 3
The size of the boxcar smoothing filter applied to the median filtered image.
statsec = ""
The input image section used to compute the recommended object detection threshold.
nsigrej = 3.0
The bad pixel rejection criterion used to compute the recommended object detection threshold.
maxiter = 20
The maximum number of bad pixel rejection iterations used to compute the recommended object detection threshold.
threshtype = "nsigma"
The threshold setting algorithm. The options are "nsigma" and "constant".
nsigma
Set the threshold to the background sky value plus the value of nsigthresh\R * the sky background sigma.
constant
Set the threshold to the background sky value plus the value of fIconstthresh.
nsigthresh = 2.0
The number of sky background sigma used to defined the threshold value for background detection.
constthresh = 0.0
The constant threshold value
negthresh = no
Set a negative as well as a positive masking threshold ?
ngrow = 0
The half_width of the region growing box. Only positive features are subject to region growing.
verbose = no
Print messages about the progress of the task.

Description

MAKEMASK creates object masks called outlist for the input images inlist using a median filtering and thresholding technique. If hinlist is defined the output object mask names are written to image header BPM keyword. Hinlist does not have to be the same as inlist.

Before median filtering the normalized input image is block-averaged by a factor of subsample. The size of the median filter filtsize refers to the block-averaged image. Therefore the effective size of the median filter is actually subsample * filtsize. The median filter can be protected against deviant values by setting checklimits to yes and zmin and zmax to reasonable values. If filtsize < 1 then no block averaging, median filtering, or block replication is done.

The median value of the input image pixels is computed using pixels in statsec and iterative rejection with rejection parameters of nsigrej and maxiter.

After the image statistics computation but before thresholding the image is smoothed using a boxcar filter of size nsmooth.

If threshtype = "nsigma" the threshold value is set to

pthreshold = median + nsigthresh * sigma / nsmooth
if (negthresh)
    nthreshold = median - nsigthresh * sigma / nsmooth
else
    nthreshold = -1.0e37

otherwise it is set to

pthreshold = median + constthresh
if (negthresh)
    nthreshold = median - constthresh
else
    nthreshold = -1.0e37

The image pixels greater than or or less than the detection threshold are set to 1 in the output object mask. The remaining pixels are set to 0. If ngrow > 0 pixels within a box of half-width ngrow pixels around positive "objects" are assumed to be object pixels.

If verbose R= yes then detailed messages about the progress of the task are printed on the screen.

Examples

1. Create object masks for a list of sky subtracted images

cl> type imlist
demo01.sub
demo02.sub
...
demo25.sub

cl> type outlist
demo01.sub.msk
demo02.sub.msk
...
demo25.sub.msk

cl> makemask @imlist @outlist nsigrej=5.0 maxiter=10

Time requirements

Bugs

See also

mkmask, blkavg, fmedian, boxcar, imexpr