apportionFlux¶
-
lsst.meas.deblender.
apportionFlux
(debResult, log, assignStrayFlux=True, strayFluxAssignment='r-to-peak', strayFluxToPointSources='necessary', clipStrayFluxFraction=0.001, getTemplateSum=False)¶ Apportion flux to all of the peak templates in each filter
Divide the
maskedImage
flux amongst all of the templates based on the fraction of flux assigned to eachtemplate
. Leftover “stray flux” is assigned to peaks based on the other parameters.Parameters: - debResult: `lsst.meas.deblender.baseline.DeblenderResult`
Container for the final deblender results.
- log: `log.Log`
LSST logger for logging purposes.
- assignStrayFlux: `bool`, optional
If True then flux in the parent footprint that is not covered by any of the template footprints is assigned to templates based on their 1/(1+r^2) distance. How the flux is apportioned is determined by
strayFluxAssignment
.- strayFluxAssignment: `string`, optional
Determines how stray flux is apportioned.
trim
: Trim stray flux and do not include in any footprintsr-to-peak
(default): Stray flux is assigned based on (1/(1+r^2) from the peaksr-to-footprint
: Stray flux is distributed to the footprints based on 1/(1+r^2) of the minimum distance from the stray flux to footprintnearest-footprint
: Stray flux is assigned to the footprint with lowest L-1 (Manhattan) distance to the stray flux
- strayFluxToPointSources: `string`, optional
Determines how stray flux is apportioned to point sources
never
: never apportion stray flux to point sourcesnecessary
(default): point sources are included only if there are no extended sources nearbyalways
: point sources are always included in the 1/(1+r^2) splitting
- clipStrayFluxFraction: `float`, optional
Minimum stray-flux portion. Any stray-flux portion less than
clipStrayFluxFraction
is clipped to zero.- getTemplateSum: `bool`, optional
As part of the flux calculation, the sum of the templates is calculated. If
getTemplateSum==True
then the sum of the templates is stored in the result (aDeblendedFootprint
).
Returns: - modified: `bool`
Apportion flux always modifies the templates, so
modified
is alwaysTrue
. However, this should likely be the final step and it is unlikely that any deblender plugins will be re-run.