Proper image subtraction - optimal transient detection, photometry and   hypothesis testing
  Transient detection and flux measurement via image subtraction stand at the base of time domain astronomy. Due to the varying seeing conditions, the image subtraction process is non-trivial, and existing solutions suffer from a variety of problems. Starting from basic statistical principles, we develop the optimal statistic for transient detection, flux measurement and any image-difference hypothesis testing. We derive a closed-form statistic that: (i) Is mathematically proven to be the optimal transient detection statistic in the limit of background-dominated noise; (ii) Is numerically stable; (iii) For accurately registered, adequately sampled images, does not leave subtraction or deconvolution artifacts; (iv) Allows automatic transient detection to the theoretical sensitivity limit by providing credible detection significance; (v) Has uncorrelated white noise; (vi) Is a sufficient statistic for any further statistical test on the difference image, and in particular, allows to distinguish particle hits and other image artifacts from real transients; (vii) Is symmetric to the exchange of the new and reference images; (viii) Is at least an order of magnitude faster to compute than some popular methods; and (ix) Is straightforward to implement. Furthermore, we present extensions of this method that make it resilient to registration errors, color-refraction errors, and any noise source that can be modelled. In addition, we show that the optimal way to prepare a reference image is the proper image coaddition presented in Zackay \& Ofek (2015b). We demonstrate this method on simulated data and real observations from the Palomar Transient Factory data release 2. We provide an implementation of this algorithm in MATLAB and Python. 
Barak Zackay, Eran O. Ofek and Avishay Gal-Yam
astro-ph.IM