Image processing: Fixing bloomed stars

Blooming

Bright stars create more electrons in a pixel than the pixel can hold. This excess charge then bleeds over into neighbouring pixels, which then saturate as well and so on. This effect is referred to as blooming and is characteristic for CCDs. It can be suppressed by so-called anti-blooming gates (ABG cameras). However, such systems reduce the effective pixel area and thus result in significantly reduced quantum efficiency. The following steps help in fixing such artifacts around bright stars.

Fixing diffraction spikes and stellar haloes

Even if a debloomer is applied on the FITS level to individual exposures, artifacts remain as in the images shown below. The symmetry of the stars is used in the fixing process. Basically, unaffected areas get copied and pasted over the affected areas after suitable transformation (rotation, flip). The example below is taken from my exposure of NGC 7640:

Step 1:
Apparently, my debloomer did not work perfectly well (it hardly ever does). Thus, select a spike with feather radius = 1 and copy it
Step 2:
The spike copied is pasted over the image and rotated counterclockwise by 90°. Then it is moved into its new position.
Step 3:
The same spike is pasted again, this time rotated clockwise to fix the lower half of the bright star. In a similar process we can fix the small star (it has a little dark dip at the bottom; rotation by 180°)
The result:

Note that during the second step two faint background objects were copied as well (yellow box). They show up in Fig. 3 next to the upper diffraction spike (upper yellow box). These objects can easily be removed from the copied pixels (see the lower yellow box) before the layers are flattened (unless of course one does not care).

Fixing blooming spikes, satellites and asteroids

A debloomer works by replacing bloomed pixels by an estimate obtained from the unaffected local neighbourhood. However, this rarely works without leaving artifacts, similar to faint satellite trails or asteroid tracks. The latter two can be removed using outlier rejection during the coaddition or (better) by suitable masking before the coaddition. A sigma-clipping however does usually not remove all the flux, as the wings of a satellite track are too faint to be detected as an outlier.

To fix those effects, one can select a few unaffected pixels of empty sky background nearby (with feather radius = 1) and copy them over the affected parts. Care should be taken that no stars are introduced in areas where there aren't any, or that stars are removed from the image.

The image below features a weak residual blooming spike that was not fully corrected by my debloomer. It is the faint line running vertically through the image. One can also see a shorter blue line coming from the upper left and running through the image centre. This was caused by an asteroid.

Step 1:
Select some empty sky
Step 2:
Empty sky has been copied over the defective parts of the image

Depending on the number of bright stars in an image I spend between 10 minutes and one hour to fix such blooming-related artifacts.