Vital Statistics

Description HEALMASK is a set of two programs designed to quickly create HEALPix masks.
Current release    2.0.0 (6 February 2013)
Licence GPL
Author Adam Hincks (mail@adh-sj.info);

Download and Installation

Here is a tarball of the current release: healmask-2.0.0.tar.gz

You can also clone the git repository from gitlab.

HEALMASK requires the following libraries: libpng, libcfitsio and libchealpix. To install, use the ./configure script. Then do make and make install.

HEALMASK In Three Brief Steps

  1. Use heal2png to create a PNG image from a HEALPix FITS file.
  2. Modify the PNG image using your favourite image editor.
  3. Use png2heal to create a HEALPix FITS file from your modified PNG image. The -m option is relevant if you need a mask.

HEALMASK In Three Less-Brief Steps

1. How to Use heal2png

The program heal2png takes a HEALPix FITS file as an input and outputs a PNG file. Currently, it always outputs (grey-scale) images with a depth of 8-bits—i.e., there are 256 pixel values. Because the main application is for making masks, it is not anticipated that this will be a limitation.

The following can be controlled with options:


bash> ./heal2png -r 10 -f 0.85 map.fits image.png
Opened map with NSIDE = 512, coordinate system 'G' and ordering "RING".
Dynamic range is 0 to 84.
Resolution is 10.00' and map size is 1945x973.
Performing Mollweide's projection.
Successfully wrote image to "test.png".

2. How to Edit the PNG Image

You can use your favourite image editor, such as the GIMP, to edit the PNG image. The most practical thing to do is to paint the image black where you might want a mask.

It is important when you save the image not to change the image dimensions or the bit-depth—png2heal expects to receive an image of the type which has been output by heal2png.

3. How to use png2heal

The program png2heal takes a PNG image, of the dimension and bit-depth output by heal2png, and creates a FITS file from it.

The intended use is to make masks, in which case the -m should be used. This will cause all black pixels in the image to be written as zeros in the FITS file, and all non-black pixels to be written as ones in the FITS file. On the other hand, if the -m option is not used, then the 256 possible values of the PNG image will be mapped to fractional values between 0 and 1 in the HEALPix map.

The default NSIDE for output maps is 512. To use a different NSIDE, use the -n option. The default coordinate system is 'C', which can be changed with the -c option; the default HEALPix ordering convention is the ring ordering, but nested can be selected with the -o option.