3.3 Weight Maps and Correlated Noise
Weight Maps
When images are combined using Drizzle, a weight map can be specified for each input image. The weight image contains information about bad pixels in the image (in that bad pixels result in lower weight values). This weight image can be provided by the user, or it can be created by AstroDrizzle according to several automatic schemes (those are discussed in the DrizzlePac User's Guide). When the final output science image is generated, an output weight map which combines information from all the input weight images, is also saved.
When a drop of value i_{xy} and user defined weight w_{xy} is added to an output image I_{xy}, with weight W_{xy} and a fractional pixel overlap of 0 < a_{xy} < 1, the resulting value of the image I^{\prime}_{xy} and W^{\prime}_{xy} are:
W^{\prime}_{xy} = a_{xy} w_{xy} + W_{xy} |
I^{\prime}_{xy} = \frac{a_{xy} i_{xy} w_{xy} + I_{xy} W_{xy}}{W^{\prime}_{xy}}. |
Drizzle has a number of advantages over standard linear reconstruction methods. Since the pixel area can be scaled by the Jacobian of the geometric distortion, it is preserved for surface and absolute photometry. Therefore, the flux in the drizzled image, that was corrected for geometric distortion, can be measured with an aperture size that's not dependent of its position on the image.
Since the Drizzle code anticipates that a given output pixel might not receive any information from an input pixel, missing data does not cause a substantial problem as long as the observer has taken enough dither samples to fill in the missing information.
The output pixels in the final drizzled image are not independent of one another, causing the noise in the output image to be correlated to some degree. In principle, the correlated noise can be fully described by creating a correlation image. However, the implementation of such schemes becomes complicated when images are shifted at subpixel scales. A more practical approach is to use the weight maps generated by Drizzle to calculate the expected RMS noise. The weight appropriate to a given value of the scale parameter (expressed here as the ratio of the output to input pixel size), can be calculated in the following way (as described by Casertano et al. 2000).
For WFPC2 and NICMOS, by definition, the inverse flat field is contained in the flat-field reference file, f. In the pipeline, the image is multiplied by f. Therefore,
\mathrm{Var} = \frac{[(f(D+B)/g) + \sigma^2]}{f^2 t^2} |
For STIS, ACS, and WFC3, by definition, the flat field is contained in the flat-field reference file, f. In the pipeline, the image is divided by f. Therefore,
\mathrm{Var} = \frac{[(f(D+B)/g) + \sigma^2 f^2]}{t^2} |
Therefore, the weight is
W = \frac{1}{\mathrm{Var} \times \mathrm{scale}^4} |
where
- D and B are the counts per pixel (in DN) due to the dark current and background, respectively, averaged over the entire image
- t is the exposure time in seconds
- g is the gain of the detector–users should be aware of the units of their image and use the appropriate gain value
- \sigma is the read noise in DN/pixel. (A more in-depth discussion of noise in drizzled images can be found in the DrizzlePac User's Guide)
Correlated Noise
Drizzle frequently divides the power from a given input pixel between several output pixels. As a result, the noise in adjacent pixels will be correlated. Understanding this effect in a quantitative manner is essential for estimating statistical errors when drizzled images are analyzed using object detection and measurement programs such as SExtractor (Bertin and Arnouts 1996) and DAOPHOT (Stetson 1987).
This noise correlation of adjacent pixels implies that a measurement of noise in a drizzled image – on the output pixel scale – underestimates the noise on larger scales. In particular, if one block-sums a drizzled image by N \times N pixels, even using a proper
weighted sum of the pixels, the per pixel noise in the block-summed image will generally be more than a factor of N greater than the per pixel noise of the original image. The factor by which the ratio of these noise values differ from N in the limit as N \rightarrow \infty is referred to as the noise correlation ratio, R.
One can easily see how this situation arises by examining Figure 3.3.
In Figure 3.3 an input pixel (broken up into two regions, a and b) is being drizzled onto an output pixel plane. Let the noise in this pixel be \epsilon and let the area of overlap of the drizzled pixel with the primary output pixel (shown with the heavier border) be a, and the areas of overlap with the other three pixels be b_1, b_2 and b_3, where b = b_1 + b_2 + b_3 and a + b = 1.
Now, the total noise power added to the image variance is \epsilon^2; however, the noise that one would measure by simply adding up the variance of the output image pixel-by-pixel would be:
(a^2 + b^2_1 + b^2_2 + b^2_3) \epsilon^2 < \epsilon^2 |
This inequality exists because all cross terms (ab_1, ab_2, b_1 b_2, ...) are missed by summing the squares of the individual pixels. These terms, which represent the correlated noise in a drizzled image, can be significant.
The Calculation
In general, the correlation between pixels, and thus, the noise correlation ratio R, depends on the choice of Drizzle parameters, as well as geometry and orientation of the dither pattern.
R often varies across an image. While it is always possible to estimate R for a given set of Drizzle parameters and dithers, in the case where all the output pixels receive equivalent inputs (in both dither pattern and noise, though not necessarily from the same input images) the situation becomes far more analytically tractable. In this case, calculating the noise properties of a single pixel gives one the noise properties of the entire image.
Consider the situation when the parameter pixfrac, p, is set to zero: there is no correlated noise in the output image since a given input pixel contributes only to the output pixel which lies under its center, and the noise in the individual input pixel is assumed to be independent.
The expected variance of the noise in that output pixel, when p = 0, is simply:
\sigma^2_c = \frac{(\sum d_{xy} \epsilon C w^2_{xy} s^4 \sigma^2_{xy})}{(\sum d_{xy} \epsilon C w_{xy})^2} |
where,
- d_{xy} represents a pixel from any of the input images
- C is in the set of all d_{xy} with centers that fall on a given output pixel of interest
- \epsilon is the standard deviation
- w_{xy} is the pixel weight
- s is the scale
- \sigma_{xy} is the standard deviation of the noise distribution of the input pixel d_{xy}
Here, \sigma_c is the standard deviation that is calculated only for cases when the input pixel value fell on the center of the output pixel.
Now consider a drizzled output image where the pixfrac p > 0. In this case, the set of pixels contributing to an output pixel will not only include input pixels with centers that fall on the output pixel, but also those pixels where a portion of the drop lands on the output pixel of interest (even when the input pixel center is not included in that portion).
The set of all input pixels with overlapping drops on a given output pixel is P, where C \subset P.
The variance of the noise in a given output pixel is then:
\sigma^2_p = \frac{(\sum d_{xy} \epsilon P a^2_{xy} w^2_{xy} s^4 \sigma^2_{xy})}{(\sum d_{xy} \epsilon P w_{xy})^2} |
where, a_{xy} is the fractional area overlap of the drop of input data pixel d_{xy} with output pixel o.
The symbol \sigma_p represents the standard deviation calculated from all pixels that contribute to the output pixels when pixfrac = p.
The degree to which \sigma^2_p and \sigma^2_c differ depends on the dither pattern and the values
of p and s. However, as more input pixels are averaged together to estimate the value
of a given output pixel in P than in C, \sigma^2_p \leq \sigma^2_c.
When p = 0, p is, by definition, equal to \sigma_c.
Now consider doing a weighted sum of the image pixels, where a region of N \times N pixels in the final drizzled image is block-averaged. This sum is equivalent to having drizzled onto an output image with a scale size N_s. But as N_s \gg p , this approaches the sum over C; or in the limit of large N, it becomes N \sigma_c.
However, a prediction of the noise in this region, based solely on a measurement of the pixel-to-pixel noise, without taking into account the correlation between pixels would produce N \sigma_c. Therefore,
R = \frac{\sigma_c}{\sigma_p} |
For a given set of Drizzle parameters and dither patterns, R can be obtained by calculating \sigma_c and \sigma_p and performing the division. However, there is a further simplification that can be made: by the assumption that inputs to each pixel are statistically equivalent, it follows that weights of the individual output pixels in the final drizzled image are independent of the choice of p. To see this, notice that the total weight of a final image (the sum of the weights of all the pixels in the final image) is independent of the choice of p. Ignoring edge pixels, the number of pixels in the final image with non-zero weight is also independent of the choice of p. Yet as the fraction of pixels within p of the edge scales as 1/N, and the weight of an interior pixel cannot depend on N, it can be seen that the weight of an interior pixel must also be independent of p. As a result,
\sum_{d_{xy} \epsilon C} w_{xy} = \sum_{d_{xy} \epsilon p} a^2_{xy} w_{xy} |
Therefore,
R^2 = \frac{\sigma^2_c}{\sigma^2_p} = \frac{\sum d_{xy} \epsilon C a^2_{xy} w^2_{xy} \sigma^2_{xy}}{\sum d_{xy} \epsilon p a^2_{xy} w^2_{xy} \sigma^2_{xy}} |
Although R must be calculated for any given set of dithers, there is one case that is particularly illustrative when there are many uniformly placed dithers across the pixel–this can approximate the effect of the dither pattern on the noise by assuming that the dither pattern is entirely uniform and continuously fills the output plane. In this case, the sums in the equations above become integrals over the output pixels, and therefore, it is not hard (though somewhat tedious) to derive R. If r = p/s, where p is pixfrac and s is scale, then in the case of a filled uniform dither pattern,
If r \geq 1, then R = \frac{r}{1 - \frac{1}{3r}}
If r \leq 1, then R = \frac{r}{1 - \frac{r}{3}}
Using the relatively typical values of p = 0.6 and s = 0.5, one finds R = 1.662. This formula can also be used when block summing the output image. For example, a weighted block-sum of N \times N pixels is equivalent to drizzling into a single pixel of size N_s. The correlated noise in the block-summed image can be estimated by replacing s with N_s in the above expressions.