Stacking images - anjavdl/PHY517_AST443 GitHub Wiki

Often, we want to ``co-add'' images to create an image with higher signal-to-noise. To do so, you first need to add the astrometric solution to the image headers, i.e. run astrometry.net . Combining images can be done with swarp:

swarp *.fits

(where *.fits should expand to a list of the images that you want to co-add). By default, swarp will perform a median-coadd, i.e. a given output pixel is the median of the input pixels. Consult the manual if you would like to change this. Also note that if you have created a bad pixel map, swarp can use this when co-adding (i.e. ignore pixels with zero weight in the combination).

You will probably want to run Source Extractor on the combined image. For best results, you need to tell Source Extractor the effective exposure of each pixel, which you can do with the weight map that swarp created (by default, coadd.weight.fits). For example, the call to source extractor would be:

sex coadd.fits -WEIGHT_IMAGE coadd.weight.fits -WEIGHT_TYPE MAP_WEIGHT