LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+7bcba2e4e8,g2079a07aa2+14824f138e,g212a7c68fe+4b38ad7149,g2305ad1205+906def1e41,g295015adf3+564da5d084,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+cff7e20090,g487adcacf7+50712f9db4,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+d19d1a10d7,g5a732f18d5+66d966b544,g64a986408d+7bcba2e4e8,g858d7b2824+7bcba2e4e8,g8a8a8dda67+a6fc98d2e7,g99cad8db69+808e2eeadf,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+9e3c062e8e,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gb983acf43b+60bb7664b7,gba4ed39666+9664299f35,gbb8dafda3b+6623599aa9,gc07e1c2157+f6e5778202,gc120e1dc64+6e28925a4e,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+cff7e20090,gdaeeff99f8+a38ce5ea23,ge6526c86ff+bcc88f9437,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+7bcba2e4e8,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst.pipe.tasks.matchBackgrounds.DataRefMatcher Class Reference

Public Member Functions

 __init__ (self, butler, datasetType)
 
 isMatch (self, ref0, ref1)
 
 matchList (self, ref0, refList)
 

Protected Member Functions

 _makeKey (self, ref)
 

Protected 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.

Parameters
----------
butler : `lsst.daf.butler.Butler`
    Butler to search for maches in.
datasetType : `str`
    Dataset type to match.

Definition at line 631 of file matchBackgrounds.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 645 of file matchBackgrounds.py.

645 def __init__(self, butler, datasetType):
646 self._datasetType = datasetType # for diagnostics
647 self._keyNames = butler.getKeys(datasetType)
648

Member Function Documentation

◆ _makeKey()

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

Parameters
----------
ref : `Unknown`
    Data reference.

Raises
------
KeyError
    Raised if ref.dataId is missing a key in keyNames.

Definition at line 649 of file matchBackgrounds.py.

649 def _makeKey(self, ref):
650 """Return a tuple of values for the specified keyNames.
651
652 Parameters
653 ----------
654 ref : `Unknown`
655 Data reference.
656
657 Raises
658 ------
659 KeyError
660 Raised if ref.dataId is missing a key in keyNames.
661 """
662 return tuple(ref.dataId[key] for key in self._keyNames)
663

◆ isMatch()

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher.isMatch ( self,
ref0,
ref1 )
Return True if ref0 == ref1.

Parameters
----------
ref0 : `Unknown`
    Data for ref 0.
ref1 : `Unknown`
    Data for ref 1.

Raises
------
KeyError
    Raised if either ID is missing a key in keyNames.

Definition at line 664 of file matchBackgrounds.py.

664 def isMatch(self, ref0, ref1):
665 """Return True if ref0 == ref1.
666
667 Parameters
668 ----------
669 ref0 : `Unknown`
670 Data for ref 0.
671 ref1 : `Unknown`
672 Data for ref 1.
673
674 Raises
675 ------
676 KeyError
677 Raised if either ID is missing a key in keyNames.
678 """
679 return self._makeKey(ref0) == self._makeKey(ref1)
680

◆ matchList()

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher.matchList ( self,
ref0,
refList )
Return a list of indices of matches.

Parameters
----------
ref0 : `Unknown`
    Data for ref 0.
`refList` : `list`

Returns
-------
matches : `tuple`
    Tuple of indices of matches.

Raises
------
KeyError
    Raised if any ID is missing a key in keyNames.

Definition at line 681 of file matchBackgrounds.py.

681 def matchList(self, ref0, refList):
682 """Return a list of indices of matches.
683
684 Parameters
685 ----------
686 ref0 : `Unknown`
687 Data for ref 0.
688 `refList` : `list`
689
690 Returns
691 -------
692 matches : `tuple`
693 Tuple of indices of matches.
694
695 Raises
696 ------
697 KeyError
698 Raised if any ID is missing a key in keyNames.
699 """
700 key0 = self._makeKey(ref0)
701 return tuple(ind for ind, ref in enumerate(refList) if self._makeKey(ref) == key0)

Member Data Documentation

◆ _datasetType

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher._datasetType
protected

Definition at line 646 of file matchBackgrounds.py.

◆ _keyNames

lsst.pipe.tasks.matchBackgrounds.DataRefMatcher._keyNames
protected

Definition at line 647 of file matchBackgrounds.py.


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