LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask Class Reference
Inheritance diagram for lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask:

Public Member Functions

def __init__
 
def run
 
def scaleVariance
 
def runDetection
 
def write
 Write out results from runDetection. More...
 

Public Attributes

 schema
 

Static Public Attributes

 ConfigClass = DetectCoaddSourcesConfig
 
tuple getSchemaCatalogs = _makeGetSchemaCatalogs("det")
 
tuple makeIdFactory = _makeMakeIdFactory("CoaddId")
 

Private Member Functions

def _makeArgumentParser
 

Static Private Attributes

string _DefaultName = "detectCoaddSources"
 

Detailed Description

Detect sources on a coadd

This operation is performed separately in each band.  The detections from
each band will be merged before performing the measurement stage.

Definition at line 111 of file multiBand.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.__init__ (   self,
  schema = None,
  kwargs 
)
Initialize the task.

Keyword arguments (in addition to those forwarded to CmdLineTask.__init__):
 - schema: the initial schema for the output catalog, modified-in place to include all
   fields set by this task.  If None, the source minimal schema will be used.

Definition at line 129 of file multiBand.py.

130  def __init__(self, schema=None, **kwargs):
131  """Initialize the task.
132 
133  Keyword arguments (in addition to those forwarded to CmdLineTask.__init__):
134  - schema: the initial schema for the output catalog, modified-in place to include all
135  fields set by this task. If None, the source minimal schema will be used.
136  """
137  CmdLineTask.__init__(self, **kwargs)
138  if schema is None:
139  schema = afwTable.SourceTable.makeMinimalSchema()
140  self.schema = schema
141  self.makeSubtask("detection", schema=self.schema)

Member Function Documentation

def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask._makeArgumentParser (   cls)
private

Definition at line 123 of file multiBand.py.

124  def _makeArgumentParser(cls):
125  parser = ArgumentParser(name=cls._DefaultName)
126  parser.add_id_argument("--id", "deepCoadd", help="data ID, e.g. --id tract=12345 patch=1,2 filter=r",
127  ContainerClass=ExistingCoaddDataIdContainer)
128  return parser
def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.run (   self,
  patchRef 
)
Run detection on a coadd

Definition at line 142 of file multiBand.py.

143  def run(self, patchRef):
144  """Run detection on a coadd"""
145  exposure = patchRef.get(self.config.coaddName + "Coadd", immediate=True)
146  if self.config.doScaleVariance:
147  self.scaleVariance(exposure.getMaskedImage())
148  results = self.runDetection(exposure, self.makeIdFactory(patchRef))
149  self.write(exposure, results, patchRef)
def write
Write out results from runDetection.
Definition: multiBand.py:184
def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.runDetection (   self,
  exposure,
  idFactory 
)
Run detection on an exposure

exposure: Exposure on which to detect
idFactory: IdFactory to set source identifiers

Returns: Struct(sources: catalog of detections,
        backgrounds: list of backgrounds
        )

Definition at line 165 of file multiBand.py.

166  def runDetection(self, exposure, idFactory):
167  """Run detection on an exposure
168 
169  exposure: Exposure on which to detect
170  idFactory: IdFactory to set source identifiers
171 
172  Returns: Struct(sources: catalog of detections,
173  backgrounds: list of backgrounds
174  )
175  """
176  backgrounds = afwMath.BackgroundList()
177  table = afwTable.SourceTable.make(self.schema, idFactory)
178  detections = self.detection.makeSourceCatalog(table, exposure)
179  sources = detections.sources
180  fpSets = detections.fpSets
181  if fpSets.background:
182  backgrounds.append(fpSets.background)
183  return Struct(sources=sources, backgrounds=backgrounds)
def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.scaleVariance (   self,
  maskedImage 
)
Scale the variance in a maskedImage

Scales the variance plane to match the measured variance.

Definition at line 150 of file multiBand.py.

151  def scaleVariance(self, maskedImage):
152  """Scale the variance in a maskedImage
153 
154  Scales the variance plane to match the measured variance.
155  """
157  ctrl.setAndMask(~0x0)
158  var = maskedImage.getVariance()
159  mask = maskedImage.getMask()
160  dstats = afwMath.makeStatistics(maskedImage, afwMath.VARIANCECLIP, ctrl).getValue()
161  vstats = afwMath.makeStatistics(var, mask, afwMath.MEANCLIP, ctrl).getValue()
162  vrat = dstats / vstats
163  self.log.info("Renormalising variance by %f" % (vrat))
164  var *= vrat
Pass parameters to a Statistics objectA class to pass parameters which control how the stats are calc...
Definition: Statistics.h:92
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
Definition: Statistics.cc:1082
def lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.write (   self,
  exposure,
  results,
  patchRef 
)

Write out results from runDetection.

Parameters
exposure:Exposure to write out
results:Struct returned from runDetection
patchRef:data reference for patch

Definition at line 184 of file multiBand.py.

185  def write(self, exposure, results, patchRef):
186  """!Write out results from runDetection
187 
188  @param exposure: Exposure to write out
189  @param results: Struct returned from runDetection
190  @param patchRef: data reference for patch
191  """
192  coaddName = self.config.coaddName + "Coadd"
193  patchRef.put(results.backgrounds, coaddName + "_calexp_detBackground")
194  patchRef.put(results.sources, coaddName + "_det")
195  patchRef.put(exposure, coaddName + "_calexp_det")
def write
Write out results from runDetection.
Definition: multiBand.py:184

Member Data Documentation

string lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask._DefaultName = "detectCoaddSources"
staticprivate

Definition at line 117 of file multiBand.py.

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.ConfigClass = DetectCoaddSourcesConfig
static

Definition at line 118 of file multiBand.py.

tuple lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.getSchemaCatalogs = _makeGetSchemaCatalogs("det")
static

Definition at line 119 of file multiBand.py.

tuple lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.makeIdFactory = _makeMakeIdFactory("CoaddId")
static

Definition at line 120 of file multiBand.py.

lsst.pipe.tasks.multiBand.DetectCoaddSourcesTask.schema

Definition at line 139 of file multiBand.py.


The documentation for this class was generated from the following file: