GNU Astronomy Utilities


Next: , Previous: , Up: SubtractSky   [Contents][Index]


6.5.3 Mask image

All of the programs in Gnuastro that do processing on the input data can also account for masked pixels. Particularly in raw data processing, there are usually a set of pixels in the image that should not be included in any analysis. For example saturated pixels on the centers of bright objects, or the edges of the image which received no data and were only used for bias calculation. The detectors or the very early processing that is done on raw images clearly identifies such cases and usually assigns an integer (or flag or mask value) to those pixels. Pixels that are good for processing usually have a zero value in the mask image. It goes without saying that the two images have to have the same size. Note that if the mask image has blank pixels, then they act like pixels with non-zero values and will be masked (see Blank pixels).

The integer values in the mask images are usually sums of powers of two. Each power of two has a specific meaning and since the sum of two different sets of powers of two are never equal, each mask value identifies a set of different properties for each masked pixels. For some analysis, some masked properties might not be a problem. Therefore a pixel that only has that property should be included. In such cases, you can use bit flags to keep some of the powers of two and remove the rest. The individual Gnuastro programs do not consider these issues. Therefore, if some masked pixels should be included in the analysis, it is best to use another tool to set the appropriate mask pixel values to zero prior to running the analysis program. We are working on such a program as part of Gnuastro. If the data type (BITPIX) of the input mask image is not an integer type, the programs will print a warning, but continue on with the analysis. This usually happens because of a mistake in specifying the file or the HDU.

The programs that accept a mask image, all share the options below. Any masked pixels will receive a NaN value (or a blank pixel, see Blank pixels) in the final output of those programs. Infact, another way to notify any of the Gnuastro programs to not use a certain set of pixels in a data set is to set those pixels equal to appropriate blank pixel value for the type of the image, Blank pixels.

-M
--mask

(=STR) Mask image file name. If this option is not given and the --mhdu option has a different value from --hdu, then the input image name will be used. If a name is specified on the command-line or in any of the configuration files, it will be used. If the program doesn’t get any mask file name, it will use all the non-blank (see Blank pixels) pixels in the image. Therefore, specifying a mask file name in any of the configuration files is not mandatory.

-H
--mhdu

(=STR) The mask image header name or number. Similar to the --hdu option, see Common options. Like --mask, this option does not have to be included in the configuration file or the command-line. However, if it is present on either of them, it will be used.


Next: , Previous: , Up: SubtractSky   [Contents][Index]