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 | List of all members
lsst.meas.base.plugins.SingleFrameClassificationPlugin Class Reference
Inheritance diagram for lsst.meas.base.plugins.SingleFrameClassificationPlugin:

Public Member Functions

def getExecutionOrder
 
def __init__
 
def measure
 
def fail
 

Public Attributes

 keyProbability
 
 keyFlag
 

Static Public Attributes

 ConfigClass = SingleFrameClassificationConfig
 

Detailed Description

A binary measure of the extendedness of a source, based a simple cut on the ratio of the
PSF flux to the model flux.

Because the fluxes on which this algorithm is based are slot measurements, they can be provided
by different algorithms, and the "fluxRatio" threshold used by this algorithm should generally
be set differently for different algorithms.  To do this, plot the difference between the PSF
magnitude and the model magnitude vs. the PSF magnitude, and look for where the cloud of galaxies
begins.

Definition at line 143 of file plugins.py.

Constructor & Destructor Documentation

def lsst.meas.base.plugins.SingleFrameClassificationPlugin.__init__ (   self,
  config,
  name,
  schema,
  metadata 
)

Definition at line 161 of file plugins.py.

162  def __init__(self, config, name, schema, metadata):
163  SingleFramePlugin.__init__(self, config, name, schema, metadata)
164  self.keyProbability = schema.addField(name + "_value", type="D",
165  doc="Set to 1 for extended sources, 0 for point sources.")
166  self.keyFlag = schema.addField(name + "_flag", type="Flag", doc="Set to 1 for any fatal failure.")

Member Function Documentation

def lsst.meas.base.plugins.SingleFrameClassificationPlugin.fail (   self,
  measRecord,
  error = None 
)

Definition at line 195 of file plugins.py.

196  def fail(self, measRecord, error=None):
197  # Override fail() to do nothing in the case of an exception. We should be setting a flag
198  # instead.
199  measRecord.set(self.keyFlag, True)
200 
201 
202 # --- Forced Plugins ---
def lsst.meas.base.plugins.SingleFrameClassificationPlugin.getExecutionOrder (   cls)

Definition at line 158 of file plugins.py.

159  def getExecutionOrder(cls):
160  return cls.CLASSIFY_ORDER
def lsst.meas.base.plugins.SingleFrameClassificationPlugin.measure (   self,
  measRecord,
  exposure 
)

Definition at line 167 of file plugins.py.

168  def measure(self, measRecord, exposure):
169  modelFlux = measRecord.getModelFlux()
170  psfFlux = measRecord.getPsfFlux()
171  modelFluxFlag = (measRecord.getModelFluxFlag()
172  if measRecord.table.getModelFluxFlagKey().isValid()
173  else False)
174  psfFluxFlag = (measRecord.getPsfFluxFlag()
175  if measRecord.table.getPsfFluxFlagKey().isValid()
176  else False)
177  flux1 = self.config.fluxRatio*modelFlux
178  if not self.config.modelErrFactor == 0:
179  flux1 += self.config.modelErrFactor*measRecord.getModelFluxErr()
180  flux2 = psfFlux
181  if not self.config.psfErrFactor == 0:
182  flux2 += self.config.psfErrFactor*measRecord.getPsfFluxErr()
183 
184  # A generic failure occurs when either FluxFlag is set to True
185  # A generic failure also occurs if either calculated flux value is NAN:
186  # this can occur if the Flux field itself is NAN,
187  # or the ErrFactor != 0 and the FluxErr is NAN
188  if numpy.isnan(flux1) or numpy.isnan(flux2) or modelFluxFlag or psfFluxFlag:
189  self.fail(measRecord)
190  else:
191  if flux1 < flux2:
192  measRecord.set(self.keyProbability, 0.0)
193  else:
194  measRecord.set(self.keyProbability, 1.0)

Member Data Documentation

lsst.meas.base.plugins.SingleFrameClassificationPlugin.ConfigClass = SingleFrameClassificationConfig
static

Definition at line 155 of file plugins.py.

lsst.meas.base.plugins.SingleFrameClassificationPlugin.keyFlag

Definition at line 165 of file plugins.py.

lsst.meas.base.plugins.SingleFrameClassificationPlugin.keyProbability

Definition at line 163 of file plugins.py.


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