maskstat: Compute mask statistics using iterative rejection
Package: xdimsum
Usage
maskstat inlist masks goodvalue
Parameters
- inlist
- The list of images for which the statistics are to be computed.
- masks
- The good data masks associated with inlist. Good data masks are assumed to consist entirely of 1's and 0's and to be the same size as the images in inlist. The number of masks must be one or equal to the number of input images.
- goodvalue
- The input mask good data value which must be 1 or 0.
- statsec = ""
- The input image section used to compute the statistics. If statsec is defined the input image and input mask names must not include an image section.
- lower = INDEF
- The initial lower bad data limit.
- upper = INDEF
- The initial upper bad data limit.
- iterstat = no
- Use the iterstat task to compute the image statistics rather than imstatistics.
- nsigrej = 3.0
- The k-sigma bad data rejection criterion.
- maxiter = 20
- The maximum number of bad data rejection cycles.
- show = yes
- Print the results for the final iteration ?
- verbose = yes
- Print the results for each iteration ?
- mean
- The returned image mean estimate.
- msigma
- The returned image standard deviation estimate.
- median
- The returned image median estimate.
- mode
- The returned image mode estimate.
Description
The mean, standard deviation, median, and mode are estimated for each masked input image in inlist and stored in the output parameters mean, msigma, median, and mode. Masks defines either a single mask to be applied to every input image or an individual mask for every input image. If iterstat = yes then the image statistics are computed using iterative rejection, otherwise no iterative rejection is performed. Results for each iteration are printed on the terminal if verbose = yes, and for the final result only if show = yes.
If statsec is defined then the statistics are computed inside an image section. In that case the input image and mask names must not include an image section. Initial values for the image statistics are computed after applying the mask and rejecting data outside the limits defined by the lower and upper parameters. New bad data limits are computed using the mean and sigma computed by the previous iteration and value of the nsigrej parameter. MASKSTAT terminates if the number of iterations >= maxiter or if no new bad pixels are detected.
MASKSTAT is a script task which calls ITERSTAT if iterstat = yes or IMSTATISTICS if iterstat = no. More information about the ITERSTAT and IMSTATISTICS algorithms can be found in the help pages for the ITERSTAT and IMSTATISTICS tasks.
Examples
1. Compute the statistics for an image through a mask where the good pixels are defined by mask values of 1.
cl> maskstat demo01 demo.pl 1
2. Repeat the previous example but do the rejection iteratively.
cl> maskstat demo01 demo.pl 1 iterstat+
3. Repeat the previous example but operate on a list of images and print only the final result.
cl> maskstat @demo.list demo.pl 1 iterstat+ verbose-
Time requirements
Bugs
See also
imstatistics, iterstat