Skip to content

Commit

Permalink
Merge pull request #15 from lsst/tickets/DM-8694
Browse files Browse the repository at this point in the history
tickets/DM-8694: Refactor deblender internal API
  • Loading branch information
fred3m committed Jan 10, 2017
2 parents 830a71d + 46b45cd commit 21a9e0f
Show file tree
Hide file tree
Showing 8 changed files with 1,689 additions and 1,047 deletions.
3 changes: 1 addition & 2 deletions examples/designdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def myimshow(im, **kwargs):
median_smooth_template=False,
monotonic_template=False,
lstsq_weight_templates=False,
findStrayFlux=False,
assignStrayFlux=False,
rampFluxAtEdge=False,
patchEdges=False)

Expand Down Expand Up @@ -255,7 +255,6 @@ def myimshow(im, **kwargs):
kwargs.update(median_smooth_template=True,
monotonic_template=True,
rampFluxAtEdge=True,
findStrayFlux=True,
assignStrayFlux=True)

elif opt.sec == 'patch':
Expand Down
1,398 changes: 368 additions & 1,030 deletions python/lsst/meas/deblender/baseline.py

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions python/lsst/meas/deblender/deblend.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ class SourceDeblendConfig(pexConf.Config):
}
)

findStrayFlux = pexConf.Field(dtype=bool, default=True,
doc='Find stray flux---flux not claimed by any child in the deblender.')

assignStrayFlux = pexConf.Field(dtype=bool, default=True,
doc='Assign stray flux to deblend children. Implies findStrayFlux.')
doc='Assign stray flux (not claimed by any child in the deblender) '
'to deblend children.')

strayFluxRule = pexConf.ChoiceField(
doc='How to split flux among peaks',
Expand Down Expand Up @@ -312,7 +310,6 @@ def deblend(self, exposure, srcs, psf):
maxNumberOfPeaks=self.config.maxNumberOfPeaks,
strayFluxToPointSources=self.config.strayFluxToPointSources,
assignStrayFlux=self.config.assignStrayFlux,
findStrayFlux=(self.config.assignStrayFlux or self.config.findStrayFlux),
strayFluxAssignment=self.config.strayFluxRule,
rampFluxAtEdge=(self.config.edgeHandling == 'ramp'),
patchEdges=(self.config.edgeHandling == 'noclip'),
Expand All @@ -336,7 +333,7 @@ def deblend(self, exposure, srcs, psf):

kids = []
nchild = 0
for j, peak in enumerate(res.peaks):
for j, peak in enumerate(res.deblendedParents[0].peaks):
heavy = peak.getFluxPortion()
if heavy is None or peak.skip:
src.set(self.deblendSkippedKey, True)
Expand Down

0 comments on commit 21a9e0f

Please sign in to comment.