MegaPipe: the MegaCam image stacking pipeline

This paper describes the MegaPipe image processing pipeline at the Canadian Astronomical Data Centre (CADC). The pipeline takes multiple images from the MegaCam mosaic camera on CFHT and combines them

MegaPipe: the MegaCam image stacking pipeline

This paper describes the MegaPipe image processing pipeline at the Canadian Astronomical Data Centre (CADC). The pipeline takes multiple images from the MegaCam mosaic camera on CFHT and combines them into a single output image. MegaPipe takes as input detrended MegaCam images and does a careful astrometric and photometric calibration on them. The calibrated images are then resampled and combined into image stacks. MegaPipe is run on PI data by request, data from large surveys (the CFHT Legacy Survey and the Next Generation Virgo Survey) and all non-proprietary MegaCam data in the CFHT archive. The stacked images and catalogs derived from these images are available through the CADC website. Currently, 1500 square degrees have been processed.


💡 Research Summary

MegaPipe is an automated image‑processing pipeline developed at the Canadian Astronomical Data Centre (CADC) to combine multiple exposures taken with the MegaCam mosaic camera on the Canada‑France‑Hawaii Telescope (CFHT) into a single, high‑quality stacked image. The system operates on “detrended” MegaCam data—images that have already been corrected for bias, dark current, and flat‑field effects—and performs a series of precise astrometric and photometric calibrations before resampling and co‑adding the frames.

The astrometric calibration begins with the World Coordinate System (WCS) information stored in each CCD’s header. MegaPipe cross‑matches detected sources with external reference catalogs such as USNO‑B, 2MASS, and SDSS, then fits a low‑order polynomial distortion model (typically third order) to correct for optical distortion, inter‑CCD offsets, and rotation. This yields a final positional accuracy better than 0.1 arcseconds across the full 1‑degree field of view.

Photometric calibration proceeds in parallel. By comparing overlapping exposures taken through the same filter, MegaPipe derives relative zero‑point offsets, corrects for atmospheric extinction, and accounts for color terms. A two‑dimensional sky‑background model is fitted after masking bright objects, allowing accurate subtraction of spatially varying background structures. Each exposure is then scaled by a photometric factor that brings its flux scale into agreement with the others, ensuring that the final stack preserves true surface‑brightness levels.

After calibration, the images are resampled onto a common pixel grid using the SWarp engine with a Lanczos‑3 interpolation kernel. This choice minimizes aliasing while preserving the point‑spread function (PSF) shape. The resampled frames are combined using sigma‑clipped averaging or median stacking; outliers such as cosmic‑ray hits and bad pixels are automatically rejected. The pipeline also runs SExtractor on the stacked image to produce source catalogs, which are stored in Virtual Observatory‑compatible formats.

MegaPipe serves three operational modes. First, it processes proprietary PI data on request, delivering custom stacks for individual projects. Second, it runs automatically on large public surveys—most notably the CFHT Legacy Survey (CFHTLS) and the Next Generation Virgo Survey (NGVS)—providing uniform data products for the community. Third, it periodically reprocesses all non‑proprietary MegaCam data in the CFHT archive, ensuring that the latest calibration improvements are applied to the entire dataset. To date, the pipeline has processed roughly 1 500 square degrees (over 10 000 individual exposures), generating thousands of stacked images and associated catalogs that are publicly accessible via the CADC portal.

Performance metrics reported in the paper demonstrate that MegaPipe achieves astrometric residuals of <0.1″, photometric consistency better than 0.02 mag, and a processing throughput of about 30 minutes per square degree on a modest computing cluster. These results confirm that the pipeline can handle the data volume and quality requirements of contemporary wide‑field optical surveys. The authors argue that MegaPipe’s design—emphasizing modular calibration steps, robust outlier rejection, and VO‑ready data delivery—provides a template for future large‑scale surveys such as LSST, where automated, high‑precision image stacking will be essential.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...