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 | Private Member Functions | List of all members
lsst.meas.astrom.matchOptimisticB.SourceInfo Class Reference
Inheritance diagram for lsst.meas.astrom.matchOptimisticB.SourceInfo:

Public Member Functions

def __init__
 
def hasCentroid
 
def isUsable
 
def isGood
 

Public Attributes

 centroidKey
 
 centroidFlagKey
 
 edgeKey
 
 saturatedKey
 
 fluxField
 
 interpolatedCenterKey
 
 parentKey
 

Private Member Functions

def _isMultiple
 

Detailed Description

Provide usability tests and catalog keys for sources in a source catalog

Fields set include:
- centroidKey  key for centroid
- centroidFlagKey  key for flag that is True if centroid is valid
- edgeKey  key for field that is True if source is near an edge
- saturatedKey  key for field that is True if source has any saturated pixels
- interpolatedCenterKey  key for field that is True if center pixels have interpolated values;
    interpolation is triggered by saturation, cosmic rays and bad pixels, and possibly other reasons
- fluxField  name of flux field

@throw RuntimeError if schema version unsupported or a needed field is not found

Definition at line 79 of file matchOptimisticB.py.

Constructor & Destructor Documentation

def lsst.meas.astrom.matchOptimisticB.SourceInfo.__init__ (   self,
  schema,
  fluxType = "Ap" 
)
Construct a SourceInfo

@param[in] schema  source catalog schema
@param[in] fluxType  flux type: typically one of "Ap" or "Psf"

@throw RuntimeError if the flux field is not found

Definition at line 93 of file matchOptimisticB.py.

93 
94  def __init__(self, schema, fluxType="Ap"):
95  """Construct a SourceInfo
96 
97  @param[in] schema source catalog schema
98  @param[in] fluxType flux type: typically one of "Ap" or "Psf"
99 
100  @throw RuntimeError if the flux field is not found
101  """
102  self.centroidKey = afwTable.Point2DKey(schema["slot_Centroid"])
103  self.centroidFlagKey = schema["slot_Centroid_flag"].asKey()
104  self.edgeKey = schema["base_PixelFlags_flag_edge"].asKey()
105  self.saturatedKey = schema["base_PixelFlags_flag_saturated"].asKey()
106  self.fluxField = "slot_%sFlux_flux" % (fluxType,)
107  self.interpolatedCenterKey = schema["base_PixelFlags_flag_interpolatedCenter"].asKey()
108  # extra keys that might be useful
109  self.parentKey = schema["parent"].asKey()
110 
111  if self.fluxField not in schema:
112  raise RuntimeError("Could not find flux field %s in source schema" % (self.fluxField,))

Member Function Documentation

def lsst.meas.astrom.matchOptimisticB.SourceInfo._isMultiple (   self,
  source 
)
private
Return True if source is likely multiple sources

Definition at line 113 of file matchOptimisticB.py.

114  def _isMultiple(self, source):
115  """Return True if source is likely multiple sources
116  """
117  if source.get(self.parentKey) != 0:
118  return True
119  footprint = source.getFootprint()
120  return footprint is not None and len(footprint.getPeaks()) > 1
def lsst.meas.astrom.matchOptimisticB.SourceInfo.hasCentroid (   self,
  source 
)
Return True if the source has a valid centroid

Definition at line 121 of file matchOptimisticB.py.

122  def hasCentroid(self, source):
123  """Return True if the source has a valid centroid
124  """
125  centroid = source.get(self.centroidKey)
126  return np.all(np.isfinite(centroid)) and not source.getCentroidFlag()
def lsst.meas.astrom.matchOptimisticB.SourceInfo.isGood (   self,
  source 
)
Return True if source is usable for matching (as per isUsable) and likely has a good centroid

For a source to have a good centroid it should not be interpolated in the center;
this includes saturated sources so we don't have to test separately for that.

Definition at line 136 of file matchOptimisticB.py.

137  def isGood(self, source):
138  """Return True if source is usable for matching (as per isUsable) and likely has a good centroid
139 
140  For a source to have a good centroid it should not be interpolated in the center;
141  this includes saturated sources so we don't have to test separately for that.
142  """
143  return self.isUsable(source) and not source.get(self.interpolatedCenterKey)
144 
145 
# The following block adds links to this task from the Task Documentation page.
def lsst.meas.astrom.matchOptimisticB.SourceInfo.isUsable (   self,
  source 
)
Return True if the source is usable for matching, even if possibly saturated

For a source to be usable it must:
- have a valid centroid 
- be not too near the edge

Definition at line 127 of file matchOptimisticB.py.

128  def isUsable(self, source):
129  """Return True if the source is usable for matching, even if possibly saturated
130 
131  For a source to be usable it must:
132  - have a valid centroid
133  - be not too near the edge
134  """
135  return self.hasCentroid(source) and not source.get(self.edgeKey)

Member Data Documentation

lsst.meas.astrom.matchOptimisticB.SourceInfo.centroidFlagKey

Definition at line 102 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.centroidKey

Definition at line 101 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.edgeKey

Definition at line 103 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.fluxField

Definition at line 105 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.interpolatedCenterKey

Definition at line 106 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.parentKey

Definition at line 108 of file matchOptimisticB.py.

lsst.meas.astrom.matchOptimisticB.SourceInfo.saturatedKey

Definition at line 104 of file matchOptimisticB.py.


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