1 import lsst.pex.config 
as pexConfig
 
   18     dummyVar = pexConfig.Field(doc=
'Dummy config variable, does nothing',
 
   19                                dtype=bool, default=
True)
 
   23     """This task serves culls the source list to sources which overlap with fakes""" 
   27     ConfigClass = mBand.MeasureMergedCoaddSourcesConfig
 
   30         """Measure and deblend""" 
   32         exposure = patchRef.get(self.config.coaddName + 
"Coadd", immediate=
True)
 
   34         """Read in the FAKE mask plane""" 
   35         mask = exposure.getMaskedImage().getMask()
 
   36         fakebit = mask.getPlaneBitMask(
'FAKE')
 
   38         sources = self.readSources(patchRef)
 
   39         self.log.
info(
"Found %d sources" % len(sources))
 
   40         """ignore objects whose footprints do NOT overlap with the 'FAKE' mask""" 
   42         for i_ss, ss 
in enumerate(sources):
 
   43             foot = ss.getFootprint()
 
   45             footTmp.intersectMask(mask, fakebit)
 
   46             if footTmp.getArea() == foot.getArea():
 
   48         removes = sorted(removes, reverse=
True)
 
   51         self.log.
info(
"Found %d sources near fake footprints" % len(sources))
 
   53         if self.config.doDeblend:
 
   54             self.deblend.
run(exposure, sources, exposure.getPsf())
 
   56             bigKey = sources.schema[
"deblend.parent-too-big"].asKey()
 
   58             numBig = sum((s.get(bigKey) 
for s 
in sources))
 
   60                 self.log.
warn(
"Patch %s contains %d large footprints that were not deblended" %
 
   61                               (patchRef.dataId, numBig))
 
   62         self.measurement.
run(exposure, sources)
 
   63         skyInfo = 
getSkyInfo(coaddName=self.config.coaddName, patchRef=patchRef)
 
   64         self.setPrimaryFlags.
run(sources, skyInfo.skyMap, skyInfo.tractInfo, skyInfo.patchInfo,
 
   65                                  includeDeblend=self.config.doDeblend)
 
   66         self.propagateFlags.
run(patchRef.getButler(), sources, self.propagateFlags.getCcdInputs(exposure),
 
   68         if self.config.doMatchSources:
 
   69             self.writeMatches(patchRef, exposure, sources)
 
   71         self.write(patchRef, sources)