In principle aperture photometry of digitized data is a straightforward procedure. Put down a computer generated aperture over the grid of data and add up the counts within the aperture. In astronomical applications the usual purpose of aperture photometry is to measure the brightness of an object without including possible contributions from contaminating sources such as bias levels, sky, defects or other stars and galaxies. Some if not all of these contaminants will always be present in a finite sized aperture and so this `background' has to be accounted for. If it were possible the best place to estimate this background would be behind the object, i.e. in the object aperture with the object not there. As this is usually not possible to achieve, except for the case of moving objects or supernovae, the usual method is to estimate the background from other regions close to the object.
Estimating the contribution in this background is not always straightforward. In the simplest case the histogram of pixel values in the background will have an approximately Gaussian distribution, due to random fluctuations, and the best estimator is a simple mean. It is however common for real astronomical situations to be less straightforward than this. Other contributors are likely to be present, such as non-random noise, bad pixels, cosmic rays, and the presence of other objects in the background. Even when the possible contaminating objects are very faint compared to the object to be measured the histogram of pixel values can be sufficiently skewed to result in the mean giving an estimate of the sky too poor for high precision photometry. In this case it is usual to use some sort of clipping (or filtering) to remove the effects of such contamination.
There are conflicting interests at work here. On the one hand it is desirable to use a large background aperture to get good statistics, but on the other hand this increases the probability of introducing extra contamination or of sampling areas which are uncharacteristic of the background near the object.
Of course if there is contamination in the background aperture then there will almost certainly be some present in the object aperture. The effects of this on the measurement depend on the density of objects and the ratio of the sizes of the object and sky apertures. If the sky aperture is larger than the object aperture and the objects are randomly distributed, then there is a greater chance of having more contaminating objects in the sky aperture than in the object aperture. If the density of objects is large then the proportion in each aperture will be similar, but when the number of objects is small then the chances of the larger aperture being disproportionately endowed will increase. This is best seen by considering the limiting case of one contaminating object and its most probable location. In astronomical situations the smaller populations tend to be the brighter objects and thus have an even greater effect on the results.
An ideal filter would therefore include the many faint objects which inhabit each aperture equally, but exclude the rare bright objects, which are more likely to occur in the larger aperture. Unfortunately in reality the spectra of densities and brightnesses are continuous and a clean rejection scheme is difficult to construct.
The best scheme would seem to be to take many independent samples using the same sized aperture as for the object. A new population is made from the mean sky value in each aperture, and the peak of the histogram of values, here called the mode, is used as the sky value. The mode is a maximum likelihood estimator and this scheme ensures that the most likely sky value averaged over the aperture size is used. The problem in this case is to get sufficient independent samples close to the object aperture and therefore individual pixel values are usually used to construct the sample population.
What these arguments are leading to is that there is no unique answer to
the question which is the best estimate for the sky; it depends on the
PHOTOM offers a choice of three estimators, a simple mean, a mean with
clipping and the mode.
When running jobs non-interactively it is best to use one of the estimators
that performs clipping: either the mode or the mean with rejection.
In the presence of positive contamination the mode will, in general,
provide the most rejection, the 2 sigma clipping the next and the mean
will provide no rejection. If the you suspect that one of the
estimators may be giving wrong results then try one of the
PHOTOM --- A Photometry Package