Skip to content

Coadding

Adam Wright edited this page Sep 19, 2017 · 10 revisions

Running coadd scripts

The central coaddition script is do_coadd_batch.sh, which has several different modes:

  • good = weighted-sum = measurement/lensing image
  • all = median combined = detection image
  • exposure = pixel-matched to “all” for indiv exposures (needed for backmasking). This does not add exposures together, it just places 10 CCDs together pixel-matched to the “all” image.

Actual coadd call examples:

  • all filters: ./do_coadd_batch.sh ${cluster} ${filter} 'all ...(other modes)...' conditions_file no no 2>&1 | tee -a OUT-coadd_${cluster}_${filter}_all.log
  • lensing filter: ./do_coadd_batch.sh ${cluster} ${filter} 'all exposures good ...(other modes)...' 2>&1 | tee -a OUT-coadd_${cluster}_${filter}_all.log

Output examples from ~/data/MACS0416-24/W-J-B/SCIENCE/coadd_MACS0416-24_all/:

  • this does median combine for detection image
  • if there are bright stars with large stellar halos then you need to run the stellar halo correction
  • main output is the output image: coadd.fits
  • ds9 -rgb -colorbar no -blue W-J-B/SCIENCE/coadd_MACS0416-24_all/coadd.fits -green W-C-RC/SCIENCE/coadd_MACS0416-24_all/coadd.fits -red W-S-Z+/SCIENCE/coadd_MACS0416-24_all/coadd.fits &

Other outputs:

  • *.sub.fits are sky subtracted images
  • *.resamp.fits are resampled images

coaddition of flags and weights

We can only read the flag values when detecting objects. Since detection is done on the “all” image, it's coadd.flag.fits and coadd.weight.fits in the coadd_${cluster}_all/ directory that are the important ones. So, for example, the rings are not flagged for the “good” coadd image, which is fine (in fact, in the 'good' mode the flags come from a simple ic command: ic -p 8 '16 1 %1 1e-6 < ?' coadd.weight.fits > coadd.flag.fits).

Note that the rings don't show up in the weights.

coaddition and swarp

The primary tool used for coaddition is swarp. Where scamp left off (with astrometric calibrated headers), swarp now picks up. For more on the particular header keywords which are relevant for projection (e.g. the tranformation matrix, which is currently encoded in CD1_1,CD1_2,CD2_1,CD2_2, and was previously contained in CDELT1 and CDELT2, as well as the very simple things encoded within CTYPE1, CTYPE2, CRVAL1, CRVAL2, CRPIX1, CRPIX2, and EQUINOX) must be carried over from the scamp output, see here: http://www.stsci.edu/hst/HST_overview/documents/multidrizzle/ch44.html