Fix Version/s: None
During the quick look into
DM-20749, it was found that the psFlux measured on the difference image is slightly biased with respect to the truth from inserted fakes. Below are two plots from the ccds used in the COSMOS HSC ap_verify dataset showing that the bias varies from ccd to ccd and seems to be a roughly constant as a function of inserted magnitude.
This is as opposed to the apFlux which does seem to recover the inputted flux.
Yes, this aperture correction needs to be done at each of the steps.
I attach an analysis Shu Liu put together testing out the new branch for 10 different visits from DC2.
This confirms that this change improves and corrects the agreement between injected sources and diaSrc psFlux measurements.
The first slide shows a separate plot for for each branch for one visit.
The next slide plots the comparison for 10 different visits.
And then there are plots that compare the diaSrc to the forced photometry that dia_pipe runs on the DIA exposures based on the DIAObjects from the association. The forced photometry itself has always agreed with the injected flux.
The final plot is a comparison of the differences between diaSrc measurements and the forced photometry (which is equivalent to the diaSrc measurements vs. the injected). The left plot shows the distribution of the flux difference divided by the uncertainty (i.e., the "pulls") compared to the expected normal distribution for sigma=1, the right shows the now perfect agreement.
An explanatory note about the labeling:
Because DC2 was done with 20.0.0 this testing is done with the u/wmwv/dia_apcorr branch, which is the exact same changes as between current master and tickets/
DM-28498, but is off 20.0.0 instead of master.
Thanks for taking care of this and producing the plots Shu and Michael. I'm making this as reviewed. Feel free to merge.
Thanks. Also a quick question, is this something standard we should expect to do for all point source flux measurements in the stack? I ask because downstream from this measure are 2 more psFlux measurements in the form of: psFlux measurements on the calexp at the location of the detected DiaSource; psFlux measurements as part of the DiaForcedSource forced measurement at the location of a DiaObject.
If that's the case, go ahead and create another ticket triggered on this one (feel free to assign it to me for now) to implement the apCorr on those two fluxes.