Fix Version/s: None
Sprint:AP F21-2 (July)
The DPDD requires us to compute the chi squared of a point source model fit on difference imaging residuals. Develop a chi squared fit for the PSF model that can be run on the residuals which can be added to the source catalog. This may need to be run in the C++ layer at the point where the measurement is made.
Post-rebase and ap_association fix Jenkins: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/34664/pipeline
Hi John Parejko, indeed there is a math error: for chi-squared we want sum( ((yi-fi)/sigma_i)**2.). The current code has sum( ((yi-fi)/sigma_i)) since you have taken the square root of the variance plane.
Attached an updated plot, after fixing the sqrt bug that Eric reported. That looks much more like what I'd expect. Note that these plots are just for DRP output, not diffims.
Krzysztof Findeisen: do you mind doing this small-ish review (~50 lines) of mixed C++ and python (the test code)? I don't know if there's a more optimal way to do the C++ calculation.
Eric Bellm: can you please ponder the plot I've uploaded and see if you agree with my math on the ticket? You can look at the calculation in the python test code if you don't want to bother with the C++.
It looks like the new calculations here increase the PsfFluxAlgorithm runtime by about 10% (roughly 52ms->58ms to run on 10k PSFs on my desktop), which is probably irrelevant in the grand scheme of things.