Background removal for source detection

8.1. Background removal for source detection#

The first step in detecting sources is to remove any background from the image. There are a number of ways to do this, ranging from subtracting a single value (typically the median or mean) from every pixel to more sophisticated methods that either fit a slowly-varying shape to the background or that smooth the input image in some way.

There is probably not a single “best” way to do this; what matters is whether you are able to detect the sources you need to detect in the images you have.

Note that the way you do background removal for source detection does not need to be the same way you do it for photometry. It is perfectly fine to use the same method for both, of course, but it is not required.