% process_mask [parameter_file]
For a given input binary mask, in which pixels have either value 0 (=invalid) or 1 (=valid), this code produces a map containing for each valid pixel, its distance (in Radians, measured between pixel centers) to the closest invalid pixel.
This distance map can then be used to define an apodized mask.
Two pixels are considered adjacent if they have at least one point in common (eg, a pixel corner or a pixel side).
It is possible to treat small holes (=cluster of adjacent invalid pixels) as valid, by specifying a minimal number of pixels and/or minimal surface area (whichever is the largest), and the resulting new mask can be output.
The output FITS files have the same ordering as the input mask (even though the processing is done in NESTED ordering).
The algorithmic complexity of the distance calculation is expected to scale like with p in [1.5,2] depending on the mask topology, even though the code has been optimized to reduce the number of calculations by a factor 102 to 103 compared to a naive implementation, and the most computationally intensive loops are parallelized with OpenMP. On a 3.06GHz Intel Core 2 Duo, the distances on a Nside=512 Galactic + Point sources mask can be computed in a few seconds, while a similar Nside=2048 mask takes a minute or less to process. For totally arbitrary masks though, the return times can be multiplied by as much as 10.
process_mask |
process_mask runs in interactive mode, self-explanatory.
process_mask filename |
When `filename' is present, process_mask enters the non-interactive mode and parses its inputs from the file `filename'. This has the following structure: the first entry is a qualifier which announces to the parser which input immediately follows. If this input is omitted in the input file, the parser assumes the default value. If the equality sign is omitted, then the parser ignores the entry. In this way comments may also be included in the file. In this example, the file contains the following qualifiers:
mask_file= wmap_temperature_analysis_mask_r9_5yr_v3.fits
hole_min_size= 100
distance_file= !/tmp/dist_wmap.fits
process_mask computes the distance in Radians from each valid pixel to the closest invalid pixel for WMAP-5 mask 'wmap_temperature_analysis_mask_r9_5yr_v3.fits', ignoring the holes containing fewer than 100 pixels, and outputs the result in '/tmp/dist_wmap.fits'.
- ■ (Initial release HEALPix 3.00)
Version 3.82, 2022-07-28