Stacking

Affiliation
American Association of Variable Star Observers (AAVSO)
Wed, 05/03/2023 - 07:13

Dear observers, what kind of stacking is preferable for further photometry - average, median or other? Well as for masterdarks and masterflats?

Affiliation
American Association of Variable Star Observers (AAVSO)
stacking

Stacking is fine, with summing, straight averaging or with some filtering like median or sigma clipping.  The stacked image should be in floating point to retain the greatest accuracy and signal/noise.  Stacking is ok for the science image or for the calibration images (darks, flats, etc.).

In more detail, summing or averaging retains the highest signal/noise, as each pixel has the maximum amount of signal.  Median filtering has the least signal/noise.  Sigma clip is a nice middle-of-the-road filtering technique.  All filtering techniques rely on Poisson-like noise statistics, and work best when many subframes are combined.  When you are dealing with only a few images (say 3), an accurate representation of the true underlying distribution is not possible and any filtering may give incorrect answers.  The problem with averaging is that all "signal" is combined, even if a cosmic ray or satellite trail affects one image.

Note that the signal/noise of the stacked image usually is about sqrt(nimages) better than a single image.  This is especially true if you are sky-noise limited in each subimage, like stacking a set of 5-minute V-band exposures to go really faint.  Likewise, stacking flat-field frames is always signal-dominated, and is the way you increase the signal/noise in a science image since the master flat will end up with very high signal/noise and won't affect the science pixel SNR.  If you are stacking much weaker images, such as very short exposures to beat down scintillation or to increase the cadence on a rapidly varying target, the read-noise of your sensor can dominate the noise statistics for things close to the sky background.

One interesting side effect of stacking is if you also shift images before stacking.  This is often necessary due to poor tracking of the telescope, or when you need to de-rotate images due to poor polar alignment.  Not all shifting algorithms are the same.  Some shift to integer pixels; some try to sub-divide a shifted pixel when the rotation is only a fraction of a pixel.  That sub-division is very difficult, especially if you are undersampled.  Remember, you are trying to analyze a circular star image with a sensor that has square pixels.  I recommend integer shifts in most cases.

Arne