The CADC website is undergoing major changes to improve appearance, web content accessibility and functionality in both official languages. The goal is to provide simpler and more effective ways to access CADC services. Many older CADC web pages will no longer be accessible after April 2014. If you require assistance with this transition please email us here .

Le site du CCDA subit une transformation majeure pour améliorer l'apparence, l'accessibilité aux contenus Web et la fonctionnalité dans les deux langues officielles. L'objectif est de fournir des moyens simples et plus efficaces pour accéder aux services du CCDA. De nombreuses pages Web anciennes du CCDA ne seront plus accessibles après avril 2014. Si vous avez besoin d'aide avec cette transition, s'il vous plaît, communiquez avec nous ici

The MegaPipe
CFHTLS pages

Images and Catalogues
Ancillary Information
Related webpages

Send comments / suggestions / problems to:

Generating stacked images and catalogues for the CFHTLS Deep Fields

This page briefly describes the procedures used to generate the stacked images and catalogues for the CFHTLS Deep Fields. In short, the procedure is to calibrate each CCD from each exposure of the MegaCam mosaic camera to high precision astrometrically and photometrically, and add the images together.

Quality Control

The data were retrieved from the CADC archive. The images have already been detrended with the Elixir pipeline. The images come with a fairly accurate (0.5-1.0 arcsecond) astrometric solution and a photometric calibration. One CCD of each exposure is inspected visually. Exposures with obviously asymmetric PSF's (due to loss of tracking) or other major defects were discarded. In some of the exposures, one or several of the CCD's in the mosaic were dead. These images were discarded.

The table here gives the number of exposures and total exposure times for each field and band. The limiting magnitudes are estimated as described here. The table also gives a link to a file listing the individual MegaPrime images by exposure number and giving the date of observation and exposure times.

Astrometric Calibration

The AstroGwyn astrometric calibration pipeline was run on the images. The first step is to run SExtractor on each image. The parameters are set so as to extract only the most reliable objects (5 sigma detections in at least 5 pixels). This catalog is further cleaned of cosmic rays and extended objects. This leaves only real objects with well defined centres: stars and (to some degree) compact galaxies.

This observed catalogue is matched to a reference catalogue. The x,y coordinates of the observed catalogue are converted to RA, Dec using the initial Elixir WCS. The catalogues are shifted in RA and Dec with respect to one another until the best match between the two catalogues is found. If there is no good match for a particular CCD (for example when the initial WCS unusually erroneous), its WCS is replaced with a default WCS and the matching procedure is restarted. Once the matching is complete, the astrometric fitting can begin. Typically 20 to 50 sources per CCD are found with this initial matching.

Elixir provides a first order solution for the WCS with typical errors on the order of 1 arcsecond. AstroGwyn improves on this to provide a higher order solution and with an accuracy of typically 0.2 arcseconds. As the accuracy of the WCS improves, the observed and reference catalogues are compared again to increase the number matching sources. A larger number of matching sources makes the astrometric solution more robust against possible errors (Proper motions, suprious detections etc) in either catalogue.

The higher order terms are determined on scale of the entire mosaic. That is to say, the distortion of the entire focal plan is measured. This distortion is well described by a polynomial with with second and fourth order terms in radius measured from the centre of the mosaic. The distortion appears to be stable over time, even when the some of the MegaPrime optics are flipped. Determining the distortion in this way means that only 2 parameters need to be determined (the coefficients of r2 and r4) with typically (20-50 stars per chip) * (36 chips) =~ 1000 observations. If the analysis is done chip-by-chip, a third order solution requires (10 parameters per chip)*(36 chips)= 360 parameters. This is less satisfactory. From the global distortion, the distortion local to each CCD is determined. The local distortion is translated into a linear part (described by the CD matrix) and a higher order part (described by the PV keywords). The high order part is 3rd order as well, but the coefficients depend directly and uniqurely on the 2 parameter global radial distortion. The error introduced by this translation is less than 0.001 arcseconds.

For the first band to be reduced (the I-band) these source catalogues were matched with the an external astrometric catalogue to provide an initial astrometric solution. This external catalogue was either the USNO A2 or the Sloan Digital Sky Survey DR5.

For the other bands, the image catalogues are first matched to the USNO to provide a rough WCS and then matched to a catalogue generated using the first image so as to precisely register the different bands. The final astrometric calibration has an internal uncertainty of about 0.03 arcseconds and an external uncertainty of about 0.2 arcseconds, as discussed here.

Photometric Calibration

The Sloan Digital Sky Survey DR7 serves as the source of photometric calibration. The Sloan ugriz filters are not identical to the MegaCam filters (as discussed here). The colour terms between the two filter sets can be described by the following equations:

u_Mega = u_SDSS - 0.241 (u_SDSS - g_SDSS)
g_Mega = g_SDSS - 0.153 (g_SDSS - r_SDSS)
r_Mega = r_SDSS - 0.024 (g_SDSS - r_SDSS)
i_Mega = i_SDSS - 0.085 (r_SDSS - i_SDSS)
z_Mega = z_SDSS + 0.074 (i_SDSS - z_SDSS)

The relations for the griz bands come from the analysis of the SNLS group. The relation for the u band comes from the CFHT web pages.

All images lying in the SDSS can be directly calibrated without referring to other standard stars such as Smith standards. The systematics in the SDSS photometry are about 0.02 magnitudes. The presence of at least 1000 usable sources in each square degree reduces the random error to effectively zero. It is possible to calibrate the individual CCDs of the mosaic individually with about 30 standards in each. For each MegaCam image, one matches the corresponding catalog to the to SDSS catalogue for that patch of sky. The difference between the instrumental MegaCam magnitudes and the SDSS magnitudes gives the zero-point for that exposure or that CCD. The zero-point is determined by median. There are about 10000 SDSS per square degree, but when one cuts by stellarity and magnitude this number drops to around 1000. It is best to only use the stars (the above colour terms are more appropriate to stars than galaxies) and to only use the objects with 17<mag<20 the brighter objects are usually saturated in the MegaCam image and including the fainter objects tends to only increase the noise in the median). This process can used any night. It is not necessary for the night to be photometric. The D2 and D3 were calibrated in this manner.

For pointings outside the SDSS, the Elixir photometric keywords are used, with modifications. The Elixir zero-points were compared to those determined from the SDSS using the procedure above for a large number of images. There are systematic offsets between the two sets of zero-points, particularly for the U-band. These offsets show variations with epoch, which are caused by modifications to Elixir pipeline (Cuillandre, private communication). There also differential offsets between the CCDs of a single image. For MegaPipe, the offsets are applied from the Elixir zero-points to bring them in line with the SDSS zero-points. The offsets are described in detail here.

Some of the CFHTLS data neither lie in the SDSS nor were taken on a photometric night. These data can not be photometrically calibrated by either Elixir or the SDSS. However, if such an image overlaps another which can be calibrated by one the preceding methods, it in turn can be calibrated.

For the Deep fields (D1 and D4), this was fairly straightforward. Since all the images in a field lie at same position, in-field photometric standards using images taken on photometric nights were established. Those standards were then used to calibrate all the data for that field. In fact, the self-consistency of the photometry was used to determine which nights were photometric. The two Deep fields which do not lie in the SDSS, the D1 and the D4, were calibrated in this manner. The initial photometry was computed for each image using the Elixir zero-points. Catalogs were generated for each image based on these zero-points and the catalogs were cross-referenced to each other to determine image-to-image variations in photometry. The photometric consistency was checked over each night. Any night showing large variation in photometry from image to image was deemed non-photometric. (Interestingly, some of these nights appear completely photometric based on the SkyProbe measurements.) While the presence of large variation indicates that the night was not photometric, the absence of such variations does not guarantee that the night was photometric. The photometric catalogs on the apparently photometric nights were compared over the run of the survey. Again, if the photometry for a given night was not consistent with that of other nights, it was flagged as non-photometric. In the end, a minimum of 5 nights per filter and per field were identified as both photometric and consistent. The images from these nights were stacked and a catalog generated from the resulting image. This catalog became the photometric reference for that field and filter.

A similar method was used for the Wide fields. The pointings within a field overlap at the edges, allowing photometric comparisons. Each filter was processed separately. First, the photometry was homogenized within each pointing. In the simplest case, all the images within a pointing could be directly calibrated using either the (corrected) Elixir zero-points or the SDSS. These pointings were flagged as “probably photometric”. If only some of the images of a pointing could be directly calibrated, these images were used as reference for the others. These pointings were also flagged as “probably photometric”. If none of the images could be calibrated directly, one of the images was used as a photometric reference for the others. The photometry of the images in this pointing would be self-consistent within itself, but probably not with adjacent pointings. These pointings were flagged as "not photometric".

Next, the photometric consistency between pointings was checked. Consistency here means a systematic zero-point difference of less than 0.03 magnitudes. If a pointing previously flagged "probably photometric" was found to be inconsistent with any other "probably photometric" or "definitely photometric" pointing, then its status was downgraded to "not photometric". On the other hand, if a pointing was consistent with at least two other adjacent pointings its status was upgraded to "definitely photometric". Having identified the "definitely photometric" pointings, the next step was to calibrate adjacent pointings. There are typically a few hundred stars in the overlap region between two adjacent pointings. Only pointings which overlap along an edge were calibrated in this manner, not pointings which only overlap at the corners. The random error associated with transferring the zero-point in this manner is typically 0.05 mags per star. When 300 stars are used, the random error drops to below 0.002 mags. Once a new pointing was calibrated by overlap, it was checked for consistency with previously calibrated pointings. If it was consistent, it was flagged as "definitely photometric" and used to calibrate other adjacent pointings. Eventually all pointings in a field were calibrated. (The procedure bore some similarity to the game "Minesweeper".) In principle transferring the zero-point in this manner could cause an increase in photometric zero-point error as the number of transfers increases. In practice all pointings were at most 2 steps away from a "definitely photometric" pointing. The W1, W2 and W4 fields were calibrated in this manner. As a check, the W3, which lies in the SDSS was also calibrated in this manner. The zero-points thus derived were found to be consistent with the zero-points derived from the SDSS to within 0.01 mags RMS.

The procedure is illustrated by the animated image below: Each box representes a Wide pointing in the W1 field. The boxes are labeled by pointing. The number underneath each label is the zero-point offset with respect to the Elixir value. The boxes are labeled in green if they are "definitely photometric", black otherwise. The numbers between the boxes are the zero-point differences between the two pointings. The absolute value is shown; the sign depends on which direction you go. The values are shown in magenta is they are unacceptably large (greater than 0.03 mags), or blue if they are acceptable. As the animation progresses, more of the pointings move to the "definitely photometric" status, until all the pointings are green, and all the zero-differences are acceptable. The numbers at the top indicates the iteration number and the maximum photometric offset.



The calibrated images were resampled and coadded using the program SWarp written by Emmanuel Bertin of Terapix. SWarp removed the sky background from each image so that its sky level was 0. It scaled each image according to the photometric calibration described above. Swarp then resampled the pixels of each input image to remove the geometric distortion measured above and placed them in the output pixel grid, which is an undistorted tangent plane projection. The values of the flux-scaled, resampled pixels for each image were then combined into the output image by taking a median. A median is noisier than an average, but rejects image defects such as cosmic rays. The loss in depth is small (about 0.1 magnitudes). The swarp parameter file is here.

The input images were weighted with mask images provided as part of the Elixir processing. The mask images had the value 1 for good data and 0 for pixels with known image defects. An inverse variance weight map was produced along with each output image. This could be used as an input when running SExtractor on the stack.

The resulting stacks measure about 20000 pixels by 20000 pixels or about 1 degree by 1 degree and are about 1.7 Gb in size. They have a sky level of 0 counts. They are scaled to have a photometric zero-point of 30.000 in AB magnitudes - that is to say, for each source:

AB_magnitude = -2.5 log_10(counts in ADU ) + 30.000

Photometric Catalogues

SExtractor also run on each file individually to produce separate catalogues. A slightly different configuration file (given here) was used.

In addition For each Deep field, SExtractor's double image mode was used to get photometry in all 5 bands, using the I band as a reference. The SExtractor parameter file is given here. The I-band is the deepest of the the 5 CFHTLS bands, so most objects visible in the other bands will be visible in I. The resulting photometric catalogues are available on the webpages detailing each field. The magnitudes in the catalogues are all in AB magnitudes, measured in Kron-style apertures (SExtractor's MAG_AUTO). These should give good estimates of the total magnitudes for each galaxies.

Finally, unified catalogs were produced, combining data from all fields and bands. These catalogs are described in detail on their own page

Catalogue masking
Masks were produced to identify areas where the detection and photometric measurements of sources may compromised. These areas include areas around brighter stars, diffraction and bleed spikes from the brightest stars and satellite/meteor trails. Also, in some cases the dither pattern of the input images was insufficient to provide uniform depth across the pointing. An automatic detection method was used to find the bright stars and the diffraction/bleed spikes. This was supplemented with laborious hand masking. The images below show examples of what was masked.
An example of bright star masking. Here the position of the bright star is taken from the the Guide Star Catalog. (SExtractor usually fails to correctly determine the centre of bright stars.) The pupil image is offset from position of the star towards the centre of the image by 0.022 times the distance between the star and the centre of the image. Example of masked bright star
An example of diffraction spike masking. The masking program masks the diffraction spikes out to a minimum distance (200 pixels) and then looks for extended bleed spikes (always in the y-direction). If they are detected it extends the mask until the end of the bleed trail. Example of masked bleed spike
An example of meteor trail masking. A meteor trail appears in a single input image. Where a large enough number input images are available, the trail disappears when the images are combined (using the median process) leaving at most some residual noise. However at the CCD boundaries of the MegaCam mosaic and over the bad columns of the input images, there may be less than the full number of images and the trail must be masked. Example of masked meteor trail
The masks are in the form of ds9 region files. They are given in terms of RA and Dec in J2000.0 coordinates. Each line starts with the word "polygon" followed by of a list of vertexes. The masks for each survey can be downloaded as a tarball using the following links:

Back to Stephen Gwyn's CFHTLS pages
Send comments/suggestions/problems to:

Valid HTML 4.01!