fitPsfs

lsst.meas.deblender.fitPsfs(debResult, log, psfChisqCut1=1.5, psfChisqCut2=1.5, psfChisqCut2b=1.5, tinyFootprintSize=2)

Fit a PSF + smooth background model (linear) to a small region around each peak.

This function will iterate over all filters in deblender result but does not compare results across filters. DeblendedPeaks that pass the cuts have their templates modified to the PSF + background model and their deblendedAsPsf property set to True.

This will likely be replaced in the future with a function that compares the psf chi-squared cuts so that peaks flagged as point sources will be considered point sources in all bands.

Parameters:
debResult: `lsst.meas.deblender.baseline.DeblenderResult`

Container for the final deblender results.

log: `log.Log`

LSST logger for logging purposes.

psfChisqCut*: `float`, optional

psfChisqCut1 is the maximum chi-squared-per-degree-of-freedom allowed for a peak to be considered a PSF match without recentering. A fit is also made that includes terms to recenter the PSF. psfChisqCut2 is the same as psfChisqCut1 except it determines the restriction on the fit that includes recentering terms. If the peak is a match for a re-centered PSF, the PSF is repositioned at the new center and the peak footprint is fit again, this time to the new PSF. If the resulting chi-squared-per-degree-of-freedom is less than psfChisqCut2b then it passes the re-centering algorithm. If the peak passes both the re-centered and fixed position cuts, the better of the two is accepted, but parameters for all three psf fits are stored in the DebldendedPeak. The default for psfChisqCut1, psfChisqCut2, and psfChisqCut2b is 1.5.

tinyFootprintSize: `float`, optional

The PSF model is shrunk to the size that contains the original footprint. If the bbox of the clipped PSF model for a peak is smaller than max(tinyFootprintSize,2) then tinyFootprint for the peak is set to True and the peak is not fit. The default is 2.

Returns:
modified: bool

If any templates have been assigned to PSF point sources then modified is True, otherwise it is False.