stacked image. This step produces the final WIRCam $J$-band catalogue.

-   The MegaCam $z'$-band catalogue of the corresponding field is then produced using a similar position and flux PSF fitting with *Sextractor*.

-   The $J$-band and $z'$-band catalogues are cross-matched so that each source in the $J$-band catalogue is associated with a $z'$ magnitude. In case there is no $z'$-band couterpart to a $J$-band detection, which is then a “$z$-dropout", the source is given the 5 sigma detection magnitude limit of the full $z'$ image as its $z'$ magnitude and the corresponding $z'-J$ colour is then considered as a lower limit of its actual colour.

Filtering and candidate selection
---------------------------------

The selection of ultracool brown dwarfs candidates in our catalogue aims at the greatest possible completeness (i.e. finding most of the ultracool dwarfs actually detectable on the images) while keeping the number of contaminants down to an acceptable level. Contaminants are particularly critical because the most promising candidates are the $z$-dropouts for which only a $J$ magnitude and a $z'-J$ lower limit on the colour is known. To keep the number of contaminants relatively low, we only selected sources with a signal-to-noise ratio above 10 in the $J$-band stack.

As 