Coadding images

Next, combine multiple shots by coaddDriver.py. hscPipe warps images to the SkyMap coordinate system (warp), and combines all images together (coadd) using the wcs and flux scale determined by mosaicking. coaddDriver.py carries out warp with wcs determination files produced in mosaic.py at first. As the second process, the correction of flux scale of each [visit, ccd] using flux scale files and coadd process are progressed. In order to reduce satellite trails, ghosts, and cosmic rays, outliers are clipped and coadd images are computed as a weighted mean of each CCD image. Finally, catalog files are produced after sky subtraction (4096 x 4096 pixels mesh). In the coadd processing, the CCD images which failed to fit a PSF model are removed.

Before executing coaddDriver.py, we have to execute skyCorrection.py from hscPipe 6. Application of the sky subtraction algorithm is done using skyCorrection.py, which writes a background model that replaces the background previously removed as part of single frame processing and removes an exposure-wide background (1000 pixel-sized super-pixels) and a scaled sky frame. Note that this doesn’t modify anything, but only writes a new background model (dataset type skyCorr):

# Directory for reduction is ~/HSC and rerun name test
# In case of using local system,
skyCorrection.py ~/HSC --calib ~HSC/CALIB --rerun test --id visit=18214..18220:2^18224..18230:2 --batch-type=smp --cores=8

# skyCorrection.py [data reduction directory] --calib [calib directory]
--rerun [rerun ] --id [visit, field, filter]
# Options
#       --id: Specify the filter and tract name for output data.

After you finish skyCorrection.py, execute coaddDriver.py. The batch system is available for coaddDriver.py

# Directory for reduction is ~/HSC and rerun name test
# In case of using local system,
coaddDriver.py ~/HSC --calib ~HSC/CALIB --rerun test --id filter=HSC-G tract=0 --selectId visit=18214..18220:2^18224..18230:2 ccd=0..103 --batch-type=smp --cores=8

# coaddDriver.py [data reduction directory] --rerun [rerun name] --id filter=[filter] tract=[tract] --selectId [visit, field, filter]
# Options
#       --id: Specify the filter and tract name for output data.
#       --selecteId: Select visits to coadd. You can also select field and filter name.

The default threshold of detection is set to 5σ. You can change this value with the option –config detectCoaddSources.detection.thresholdValue.

The generated images are summarized below;

  • warp image: ~/HSC/rerun/[rerun]/deepCoadd/[filter]/[tract]/[patch]/warp-[filter]-[tract]-[patch]-[visit].fits
  • coadd image: ~/HSC/rerun/[rerun]/deepCoadd-results/[filter]/[tract]/[patch]/calexp-[filter]-[tract]-[patch].fits
  • sky background image: ~/HSC/rerun/[rerun]/deepCoadd-results/[filter]/[tract]/[patch]/det_bkgd-[filter]-[tract]-[patch].fits

Figure 1 shows warp and coadd images at a certain patch. The coadd image includes a mask image as well as CORR files.

../_images/warp_coadd.png

Figure 1:warp and coadd images at a certain patch. (left, center) warp image of 2 visits. (right) final coadd image.

You can see all [patch]/calexp data in one window with ds9 -mosaic option.

# Display all coadd images in one window with ds9
cd ~/HSC/rerun/[rerun]/deepCoadd-results/[filter]/[tract]/[patch]
ds9 -mosaic wcs */calexp-*.fits

# The ds9 calibrates a scale of coadd images in all field of views with Scale > Scope > Global button.
../_images/coadd.png

Figure 2:Display all coadd image in one window.

Useful tools for combining all images are available:

1) This tool stitches adjacent patches in the same tract together. https://hsc-gitlab.mtk.nao.ac.jp/snippets/2

2) This one allows you to stitch patches in different tracts together. https://hsc-gitlab.mtk.nao.ac.jp/snippets/30

These tools require HSC (or LSST) pipeline.

Note

The magnitude zero-point of coadd-images is 27.0mag/ADU. However, it is not correct at a few percent level because of aperture correction.

The detected objects are listed in the following catalog;

  • Detected object catalog: ~/HSC/rerun/[rerun]/deepCoadd-results/[filter]/[tract]/[patch]/det-[filter]-[tract]-[patch].fits

det*.fits just list objects detected. Photometry of them have not been performed yet.

Warning

When the warp images already exist, coaddDriver.py does not overwrite warp images. So if you create new coadd images from the same data, you have to move or remove the old data.