LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+a41d3748ce,g1470d8bcf6+6be6c9203b,g2079a07aa2+14824f138e,g212a7c68fe+a4f2ea4efa,g2305ad1205+72971fe858,g295015adf3+ab2c85acae,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+31b3a28dff,g487adcacf7+082e807817,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+b2918d57ae,g5a732f18d5+66d966b544,g64a986408d+a41d3748ce,g858d7b2824+a41d3748ce,g8a8a8dda67+a6fc98d2e7,g99cad8db69+7fe4acdf18,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+84af8b3ff8,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+d8d527deb2,gc07e1c2157+b2dbe6b631,gc120e1dc64+61440b2abb,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+31b3a28dff,gdaeeff99f8+a38ce5ea23,ge6526c86ff+39927bb362,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+a41d3748ce,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Attributes | List of all members
lsst.meas.astrom.directMatch.DirectMatchTask Class Reference
Inheritance diagram for lsst.meas.astrom.directMatch.DirectMatchTask:

Public Member Functions

 __init__ (self, refObjLoader=None, **kwargs)
 
 setRefObjLoader (self, refObjLoader)
 
 run (self, catalog, filterName=None, epoch=None)
 
 calculateCircle (self, catalog)
 

Public Attributes

 refObjLoader
 

Static Public Attributes

 ConfigClass = DirectMatchConfig
 

Static Protected Attributes

str _DefaultName = "directMatch"
 

Detailed Description

Simple, brute force matching of a source catalog to a reference catalog.

Parameters
----------
butler : `None`
    Compatibility parameter. Should not be used.
refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader` or `None`
    A reference object loader object; gen3 pipeline tasks will pass `None`
    and call `setRefObjLoader` in `runQuantum`.
**kwargs
    Other keyword arguments required for instantiating a Task (such as
    ``config``).

Definition at line 30 of file directMatch.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.astrom.directMatch.DirectMatchTask.__init__ ( self,
refObjLoader = None,
** kwargs )

Definition at line 47 of file directMatch.py.

47 def __init__(self, refObjLoader=None, **kwargs):
48 Task.__init__(self, **kwargs)
49 self.refObjLoader = refObjLoader
50 self.makeSubtask("sourceSelection")
51 self.makeSubtask("referenceSelection")
52

Member Function Documentation

◆ calculateCircle()

lsst.meas.astrom.directMatch.DirectMatchTask.calculateCircle ( self,
catalog )
Calculate a circle enclosing the catalog.

Parameters
----------
catalog : `lsst.afw.table.SourceCatalog`
    Catalog to encircle.

Returns
-------
result : `lsst.pipe.base.Struct`
    Result struct with components:

    ``center``
        ICRS center coordinate (`lsst.afw.geom.SpherePoint`).
    ``radius``
        Radius of the circle (`lsst.geom.Angle`).

Definition at line 110 of file directMatch.py.

110 def calculateCircle(self, catalog):
111 """Calculate a circle enclosing the catalog.
112
113 Parameters
114 ----------
115 catalog : `lsst.afw.table.SourceCatalog`
116 Catalog to encircle.
117
118 Returns
119 -------
120 result : `lsst.pipe.base.Struct`
121 Result struct with components:
122
123 ``center``
124 ICRS center coordinate (`lsst.afw.geom.SpherePoint`).
125 ``radius``
126 Radius of the circle (`lsst.geom.Angle`).
127 """
128 coordList = [src.getCoord() for src in catalog]
129 center = averageSpherePoint(coordList)
130 radius = max(center.separation(coord) for coord in coordList)
131 return Struct(center=center, radius=radius + self.config.matchRadius*arcseconds)
int max

◆ run()

lsst.meas.astrom.directMatch.DirectMatchTask.run ( self,
catalog,
filterName = None,
epoch = None )
Load reference objects and match to them.

Parameters
----------
catalog : `lsst.afw.table.SourceCatalog`
    Catalog to match.
filterName : `str`
    Name of filter loading fluxes.
epoch : `astropy.time.Time` or `None`
    Epoch to which to correct proper motion and parallax, or `None` to
    not apply such corrections.

Returns
-------
result : `lsst.pipe.base.Struct`
    Result struct with components:

    ``matches``
        Matched sources with associated reference
        (`lsst.afw.table.SourceMatchVector`).
    ``matchMeta``
        Match metadata (`lsst.meas.astrom.MatchMetadata`).

Definition at line 63 of file directMatch.py.

63 def run(self, catalog, filterName=None, epoch=None):
64 """Load reference objects and match to them.
65
66 Parameters
67 ----------
68 catalog : `lsst.afw.table.SourceCatalog`
69 Catalog to match.
70 filterName : `str`
71 Name of filter loading fluxes.
72 epoch : `astropy.time.Time` or `None`
73 Epoch to which to correct proper motion and parallax, or `None` to
74 not apply such corrections.
75
76 Returns
77 -------
78 result : `lsst.pipe.base.Struct`
79 Result struct with components:
80
81 ``matches``
82 Matched sources with associated reference
83 (`lsst.afw.table.SourceMatchVector`).
84 ``matchMeta``
85 Match metadata (`lsst.meas.astrom.MatchMetadata`).
86 """
87 if self.refObjLoader is None:
88 raise RuntimeError("Running matcher task with no refObjLoader set in __ini__ or setRefObjLoader")
89 circle = self.calculateCircle(catalog)
90 matchMeta = self.refObjLoader.getMetadataCircle(circle.center, circle.radius, filterName, epoch=epoch)
91 emptyResult = Struct(matches=[], matchMeta=matchMeta)
92 sourceSelection = self.sourceSelection.run(catalog)
93 if len(sourceSelection.sourceCat) == 0:
94 self.log.warning("No objects selected from %d objects in source catalog", len(catalog))
95 return emptyResult
96 refData = self.refObjLoader.loadSkyCircle(circle.center, circle.radius, filterName, epoch=epoch)
97 refCat = refData.refCat
98 refSelection = self.referenceSelection.run(refCat)
99 if len(refSelection.sourceCat) == 0:
100 self.log.warning("No objects selected from %d objects in reference catalog", len(refCat))
101 return emptyResult
102 matches = afwTable.matchRaDec(refSelection.sourceCat, sourceSelection.sourceCat,
103 self.config.matchRadius*arcseconds)
104 self.log.info("Matched %d from %d/%d input and %d/%d reference sources",
105 len(matches), len(sourceSelection.sourceCat), len(catalog),
106 len(refSelection.sourceCat), len(refCat))
107 return Struct(matches=matches, matchMeta=matchMeta, refCat=refCat, sourceSelection=sourceSelection,
108 refSelection=refSelection)
109
std::vector< Match< typename Cat1::Record, typename Cat2::Record > > matchRaDec(Cat1 const &cat1, Cat2 const &cat2, lsst::geom::Angle radius, MatchControl const &mc=MatchControl())
Compute all tuples (s1,s2,d) where s1 belings to cat1, s2 belongs to cat2 and d, the distance between...
Definition Match.cc:158

◆ setRefObjLoader()

lsst.meas.astrom.directMatch.DirectMatchTask.setRefObjLoader ( self,
refObjLoader )
Set the reference object loader for the task.

Parameters
----------
refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader`
    An instance of a reference object loader.

Definition at line 53 of file directMatch.py.

53 def setRefObjLoader(self, refObjLoader):
54 """Set the reference object loader for the task.
55
56 Parameters
57 ----------
58 refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader`
59 An instance of a reference object loader.
60 """
61 self.refObjLoader = refObjLoader
62

Member Data Documentation

◆ _DefaultName

str lsst.meas.astrom.directMatch.DirectMatchTask._DefaultName = "directMatch"
staticprotected

Definition at line 45 of file directMatch.py.

◆ ConfigClass

lsst.meas.astrom.directMatch.DirectMatchTask.ConfigClass = DirectMatchConfig
static

Definition at line 44 of file directMatch.py.

◆ refObjLoader

lsst.meas.astrom.directMatch.DirectMatchTask.refObjLoader

Definition at line 49 of file directMatch.py.


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