Science:Difference Imaging

From VVV Survey

Jump to: navigation, search



This is an update on work we are doing to implement a difference image analysis (DIA) pipeline for the VVV dataset.

DIA vs conventional crowded field photometry

Difference imaging was developed to provide optimal relative photometry in crowded stellar fields. Using a flexible set of basis functions to model PSF and background variations the DIA method allows a high quality reference image to be matched and subtracted from each target frame to create a difference image which records only variable objects. The reference image may be constructed from several of the very best quality exposures so that the noise on the resulting difference image is limited essentially only by the noise on the target frame.

There are advantages but also disadvantages to using DIA rather than conventional photometry software.


  1. Allows photometry beyond the crowding limit where conventional methods cannot be used with confidence
  2. Good for photometry of faint objects, particularly if their PSF is blended with nearby brighter stars
  3. Provides an unbiased astrometric position of variables free from the effects of blending
  4. Can cope with smooth spatial variations in the PSF and background
  5. Capable of high-precision photometry in crowded fields given well behaved data.


  1. Optimal DIA requires an optimal reference image. The recipe for building such a reference from a given set of data is an unsolved problem.
  2. DIA uses global image information and therefore photometry in one region may be affected by image systematics in another.
  3. PSF must be reasonably well sample >~ 2.5 pixels/FWHM. **This is a potential issue for VVV data**.
  4. The method does not cope well with complicated time-varying backgrounds, though this can be worked around by separating out the photometric and PSF matching stages.

DIA Software

The current pipeline is based on ISIS Version 2.2 written by Christophe Alard. There are two papers which describe the basic theory underlying the algorithm, which can be accessed here and here.

The following modifications have been made to the ISIS code for the VVV pipeline:

  1. Replaced multiple fits read/write routines with cfitsio calls for proper handling of FITS extensions and for header propagation
  2. Implemented a double-pass algorithm for a more robust PSF solution (see Test pipeline)
  3. Differential background matching can be performed separately from the convolution stage to enable better modelling of complex time variable backgrounds (see Test pipeline)

Test pipeline

The current testing pipeline comprises the following distinct stages:

  1. Pipeline starts with stacked calibrated pawprints from CASU.
  2. DIA is performed separately on each detector within a paw in order to ensure the best possible PSF kernel solution. Therefore 16 separate runs are required to produce a difference image of a full pawprint. Currently the same DIA configuration is used for each detector except that different saturation levels are used based on the individual limits for each detector.
  3. Image alignment using WCS information
  4. Optionally, images may be photometrically aligned before difference imaging. Alignment first involves a quick linear scaling. Then a target image is directly subtracted from a photometric reference to produce a residual frame. The residual frame is smoothed using a Gaussian filter with an aperture much larger than the seeing scale (e.g. sigma = 50 pixels) and then this is added back onto the target frame to yield a background-matched target image.
  5. A reference image is built from a stack of images. Currently with limited synoptic coverage we are usually testing with either a single image or a stack built from all available images. For now stacking currently involves a straight median stack (rather than PSF matching and then stacking). This means there is a single convolution performed to produce the final difference image which allows us to see the effects of parameter tuning more clearly.
  6. Two pass DIA is performed. This first involves running the modified ISIS subtract.csh routine in the standard way to produce an inital difference image. Residual DIA flux above a specified maximum absolute threshold is then added onto the target frame to produce a modified "variability suppressed" target. The ISIS subtract stage is then repeated on this modified image. The resulting PSF transformation is applied to the reference image and then it is subtracted from the original target frame to produce the final difference image. This two-stage approach minimizes the impact of artefacts and residuals from bright saturated stars on the derived kernel solution.
  7. A variability image is produced by stacking the rms difference images (unmodified from ISIS)
  8. The coordinates of variables are obtained from the variability image (unmodified from ISIS)
  9. PSF-fitting photometry is performed on the difference images at the location of each variable (unmodified from ISIS)
  10. A light-curve library is produced (unmodified from ISIS)

Test data

Testing to date is based on 15 Ks-band epochs of 2009 SV data for the bulge and 7 Ks-band epochs of P85 data (from March 2010) for disk tile d001.

Example difference image from the disk field d001
Click here for larger view
D001-dia-features.png The left-hand image is the orignal stacked Ks band image from one detector. On the right the corresponding difference image is shown. Obvious features are: residuals from bright stars (compact spiky features); noise limited background (grey-looking background showing no variation); and variable objects (compact black and white spots showing stars which have dimmed or brightened). A few examples of real variables are visible towards the upper left of the difference image. The reference image is constructed from a stack of 7 epochs of P85 data from March 2010 (all available epochs at time of writing).

Uniformity of difference imaging across a paw
Click here for larger view
Diaacross-arrays.png The image shows 16 DIA images from one pawprint. Whilst the PSF varies across the tile the resulting difference images show a high level of uniformity.

Robustness of difference imaging near strongly saturated sources
Click here for larger view
Satstarbig.png In this image there is a very bright saturated source in the top right. Whilst this gives rise to nasty residuals in the vicinity of the star itself the rest of the difference image (right) is largely unaffected.

Comparison of SV bulge and P85 disk results
Click here for larger view
Blgvsdiskbig.png A difference image from the 2009 SV bulge data (left) and one from the disk field during P85 (right). The SV bulge difference images are of significantly poorer quality than we get from the test disk field. Some of this will be due to the higher background level, leading to higher levels of noise. However we are currently investigating why the kernel residuals are so much worse around bright stars in the SV data. Hopefully further testing and additional synoptic coverage of the bulge will improve things.

To do list

  1. Continue testing by looking at variation in DIA quality over a range of longitude from the outer disk fields in towards the bulge. Use this, together with additional synoptic coverage from incoming P85 data to improve the quality of the bulge DIA images.
  2. Work on an algorithm for the selection of images to be used to create the reference frames. We will likely need a different combination of epochs for different tiles so we need an algorithm which can do this selection automatically. This is a one-off task in that once the reference is established it will (hopefully!) not be changed or updated for future data.
  3. Integrate final DIA pipeline into existing pipelines (VSA, Chile, ...?)

Further info

Eamonn Kerins gave a talk on VVV difference imaging at the VVV/UKIDSS meeting in Leeds, UK on Thursday 8th July 2010.

Personal tools