1 from deprecated.sphinx
import deprecated
3 import lsst.pex.config
as pexConfig
19 dummyVar = pexConfig.Field(doc=
'Dummy config variable, does nothing',
20 dtype=bool, default=
True)
24 """This task serves culls the source list to sources which overlap with fakes"""
29 ConfigClass = measAlg.SourceDetectionConfig
31 def run(self, table, exposure, doSmooth=True, sigma=None, clearMask=True):
32 if self.negativeFlagKey
is not None and self.negativeFlagKey
not in table.getSchema():
33 raise ValueError(
"Table has incorrect Schema")
36 fpSets = self.detectFootprints(exposure=exposure, doSmooth=doSmooth, sigma=sigma,
40 mask = exposure.getMaskedImage().getMask()
41 fakebit = mask.getPlaneBitMask(
'FAKE')
42 fpPos = fpSets.positive.getFootprints()
44 for i_foot, foot
in enumerate(fpPos):
46 footTmp.intersectMask(mask, fakebit)
47 if footTmp.getArea() == foot.getArea():
48 removes.append(i_foot)
49 removes = sorted(removes, reverse=
True)
53 self.log.
info(
"Found %d sources near fake footprints" % len(fpPos))
55 fpSets.numPos = len(fpPos)
57 del fpSets.negative.getFootprints()[0:]
58 fpSets.negative =
None
62 table.preallocate(fpSets.numPos)
64 fpSets.positive.makeSources(sources)
66 return pipeBase.Struct(sources=sources, fpSets=fpSets)
68 @deprecated(reason=
"Replaced by OnlyFakesDetectionTask.run(). Will be removed after v20.",
69 category=FutureWarning)
71 return self.
run(*args, **kwargs)