We present a simple method for adaptively binning the pixels in an image. The
algorithm groups pixels into bins of size such that the fractional error on the
photon count in a bin is less than or equal to a threshold value, and the size
of the bin is as small as possible. The process is particularly useful for
generating surface brightness and colour maps, with clearly defined error maps,
from images with a large dynamic range of counts, for example X-ray images of
galaxy clusters. We demonstrate the method in application to data from Chandra
ACIS-S and ACIS-I observations of the Perseus cluster of galaxies. We use the
algorithm to create intensity maps, and colour images which show the relative
X-ray intensities in different bands. The colour maps can later be converted,
through spectral models, into maps of physical parameters, such as temperature,
column density, etc. The adaptive binning algorithm is applicable to a wide
range of data, from observations or numerical simulations, and is not limited
to two-dimensional data.Comment: 8 pages, 12 figures, accepted by MNRAS (includes changes suggested by
referee), high resolution version at
http://www-xray.ast.cam.ac.uk/~jss/adbin