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 | Private Member Functions | Private Attributes | List of all members
lsst.pipe.tasks.matchBackgrounds.DataRefMatcher Class Reference
Inheritance diagram for lsst.pipe.tasks.matchBackgrounds.DataRefMatcher:

Public Member Functions

def __init__
 
def isMatch
 
def matchList
 

Private Member Functions

def _makeKey
 

Private Attributes

 _datasetType
 
 _keyNames
 

Detailed Description

Match data references for a specified dataset type
    
Note that this is not exact, but should suffice for this task
until there is better support for this kind of thing in the butler.

Definition at line 578 of file matchBackgrounds.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.matchBackgrounds.DataRefMatcher.__init__ (   self,
  butler,
  datasetType 
)
Construct a DataRefMatcher

@param[in] butler
@param[in] datasetType: dataset type to match

Definition at line 584 of file matchBackgrounds.py.

585  def __init__(self, butler, datasetType):
586  """Construct a DataRefMatcher
587 
588  @param[in] butler
589  @param[in] datasetType: dataset type to match
590  """
591  self._datasetType = datasetType # for diagnostics
592  self._keyNames = butler.getKeys(datasetType)

Member Function Documentation

def lsst.pipe.tasks.matchBackgrounds.DataRefMatcher._makeKey (   self,
  ref 
)
private
Return a tuple of values for the specified keyNames

@param[in] ref: data reference

@raise KeyError if ref.dataId is missing a key in keyNames

Definition at line 593 of file matchBackgrounds.py.

594  def _makeKey(self, ref):
595  """Return a tuple of values for the specified keyNames
596 
597  @param[in] ref: data reference
598 
599  @raise KeyError if ref.dataId is missing a key in keyNames
600  """
601  return tuple(ref.dataId[key] for key in self._keyNames)
def lsst.pipe.tasks.matchBackgrounds.DataRefMatcher.isMatch (   self,
  ref0,
  ref1 
)
Return True if ref0 == ref1

@param[in] ref0: data ref 0
@param[in] ref1: data ref 1

@raise KeyError if either ID is missing a key in keyNames

Definition at line 602 of file matchBackgrounds.py.

603  def isMatch(self, ref0, ref1):
604  """Return True if ref0 == ref1
605 
606  @param[in] ref0: data ref 0
607  @param[in] ref1: data ref 1
608 
609  @raise KeyError if either ID is missing a key in keyNames
610  """
611  return self._makeKey(ref0) == self._makeKey(ref1)
def lsst.pipe.tasks.matchBackgrounds.DataRefMatcher.matchList (   self,
  ref0,
  refList 
)
Return a list of indices of matches

@return tuple of indices of matches

@raise KeyError if any ID is missing a key in keyNames

Definition at line 612 of file matchBackgrounds.py.

613  def matchList(self, ref0, refList):
614  """Return a list of indices of matches
615 
616  @return tuple of indices of matches
617 
618  @raise KeyError if any ID is missing a key in keyNames
619  """
620  key0 = self._makeKey(ref0)
621  return tuple(ind for ind, ref in enumerate(refList) if self._makeKey(ref) == key0)

Member Data Documentation

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher._datasetType
private

Definition at line 590 of file matchBackgrounds.py.

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher._keyNames
private

Definition at line 591 of file matchBackgrounds.py.


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