xmskcombine: Combine bad pixel, cosmic ray, holes, and object masks

Package: xdimsum

Usage

xmkscombine inlist bpmask crmasks hmasks omasks rmasks

Parameters

inlist
The input sky subtracted image list.
bpmask
The input bad pixel mask common to all the input sky subtracted images. The bad pixel mask is assumed to consist of 1's and 0's where 0 defines a bad pixel. If no bad pixel mask is defined a virtual bad pixel mask consisting entirely of 1's is assumed.
crmasks
The list of input cosmic ray masks normally produced by the xzap or xnzap tasks. The cosmic ray mask is assumed to consist of 1's and 0's where 1 defines a cosmic ray. Crmasks may define a list masks which has the same length as inlist, or an image keyword containing the name of the cosmic ray mask. The default keyword name written by xzap and xnzap is "CRMASK". If no cosmic ray mask is defined a virtual cosmic ray mask consisting entirely of 0's is defined.
hmasks
The list of input holes masks normally produced by the xslm task. The holes mask is assumed to consist of 1's and 0's where 0 defines a hole or undefined pixel in the input image sky subtracted image which contains no good data. Hmasks may define a list of masks which has the same length as inlist or an image keyword containing the name of the holes mask. The default keyword name written by xslm is "HOLES". If no holes mask is defined a virtual holes mask consisting entirely of 1's is defined.
omasks
The list of input object masks normally produced by the mkmask / maskdereg tasks. The objects mask is assumed to consist of 1's and 0's where 1 defines and object and 0 defines the sky. Omasks may define a list of masks which has the same length as inlist or an image keyword containing the name of the object mask. The default keyword name written by maskdereg is "OBJMASK". If no objects mask is defined a virtual objects mask consisting entirely of 0's is defined. Object masks are only used if nprev_omask > 0.
rmasks
The list of output rejection masks or the string appended to the input sky subtracted image name to create the output rejection mask name. New rejection masks are not created if only the bad pixel mask bpmask is defined. Rejection masks consist entirely of 0's and 1's with 0's defining the bad pixels and are suitable for input to the XNREGISTAR task. The name of the rejection mask is written to the REJMASK keyword in the input image.
nprev_omask = 0
The number of previous object masks to combine to create an objects mask. By default no object masks are defined. If nprev_omask is 1 then the object mask of the previous image is used to mask the current image, if nprev_omask = 2 then the 2 previous object masks are used, etc.

Description

XMSKCOMBINE combines the bad pixel mask bpmask, the cosmic ray masks crmasks (normally written by the XZAP or XNZAP tasks), the holes masks hmasks (normally written by the XSLM task), and the previous object masks omasks (normally written by the MKMASK and MASKDEREG tasks) into combined rejection masks rmasks corresponding to the sky subtracted images in inlist.

The final combined mask which is suitable for input to the XNREGISTAR tasks consists entirely of 0's and 1's where 0's define the bad pixels.

Users may befine their own crmasks, hmasks, and omasks lists or set these parameters to the appropriate input image header keyword, normally CRMASK, HMASK, and OBJMASK respectively.

Examples

1. Combine the first pass bad pixel mask. Note that in this no new masks are written because the rejection mask is equal to the bad pixel mask. The bad pixel mask name is written to the REJMASK keyword.

cl> type simlist
demo01.sub.im
demo02.sub.imh
demo03.sub.imh
...
...
demo24.sub.imh
demo25.sub.imh

cl> xmskcombine @simlist demo.pl "" "" "" ".rjm"

2. Combine the first pass bad pixel mask and the cosmic ray masks. The rejection mask name is written to the REJMASK keyword.

cl> type simlist
demo01.sub.im
demo02.sub.imh
demo03.sub.imh
...
...
demo24.sub.imh
demo25.sub.imh

cl> xmskcombine @simlist demo.pl CRMASK "" "" ".rjm"

3. Combine the bad pixel, cosmic ray, holes, and previous object masks. The rejection mask name is written to the REJMASK keyword.

cl> type simlist
demo01.sub.im
demo02.sub.imh
demo03.sub.imh
...
...
demo24.sub.imh
demo25.sub.imh

cl> xmskcombine @simlist demo.pl CRMASK HOLES OBJMASK ".rjm"

Time requirements

Bugs

See also

xslm,xzap,xnzap,mkmask,mkdereg,xnregistar