LSST Applications g04e9c324dd+8c5ae1fdc5,g134cb467dc+1b3060144d,g18429d2f64+f642bf4753,g199a45376c+0ba108daf9,g1fd858c14a+2dcf163641,g262e1987ae+7b8c96d2ca,g29ae962dfc+3bd6ecb08a,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+53e1a9e7c5,g4595892280+fef73a337f,g47891489e3+2efcf17695,g4d44eb3520+642b70b07e,g53246c7159+8c5ae1fdc5,g67b6fd64d1+2efcf17695,g67fd3c3899+b70e05ef52,g74acd417e5+317eb4c7d4,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+2efcf17695,g8d7436a09f+3be3c13596,g8ea07a8fe4+9f5ccc88ac,g90f42f885a+a4e7b16d9b,g97be763408+ad77d7208f,g9dd6db0277+b70e05ef52,ga681d05dcb+a3f46e7fff,gabf8522325+735880ea63,gac2eed3f23+2efcf17695,gb89ab40317+2efcf17695,gbf99507273+8c5ae1fdc5,gd8ff7fe66e+b70e05ef52,gdab6d2f7ff+317eb4c7d4,gdc713202bf+b70e05ef52,gdfd2d52018+b10e285e0f,ge365c994fd+310e8507c4,ge410e46f29+2efcf17695,geaed405ab2+562b3308c0,gffca2db377+8c5ae1fdc5,w.2025.35
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.pipe.tasks.drpAssociationPipe Namespace Reference

Classes

class  DrpAssociationPipeConnections
 

Functions

 _addDiaObjectCoords (self, objects, sources)
 
 _trimToPatch (self, cat, innerPatchBox, innerTractSkyRegion, wcs)
 

Variables

 visitInfo = finalVisitSummary.find(detector).visitInfo
 
 bbox = finalVisitSummary.find(detector).getBBox()
 
 wcs = finalVisitSummary.find(detector).wcs
 
 ssoAssocResult
 
 associatedSsSources = ssoAssocResult.associatedSsSources
 
 associatedSsDiaSources = ssoAssocResult.ssoAssocDiaSources
 
 ssInTractPatch
 
 assocDiaSrcIds = set(associatedSsSources['diaSourceId'])
 
list diaSrcMask = [diaId in assocDiaSrcIds for diaId in associatedSsDiaSources['diaSourceId']]
 
 unassociatedSsObjects = ssoAssocResult.unassociatedSsObjects
 
 ssObjInTractPatch
 
 nSsSrc = ssInTractPatch.sum()
 
 nSsObj = ssObjInTractPatch.sum()
 
 diaCat = ssoAssocResult.unAssocDiaSources.to_pandas()
 
 diaInTractPatch
 
 nDiaSrc = diaInTractPatch.sum()
 
 diaSourceHistoryCat = pd.concat(diaSourceHistory)
 
 ssSourceHistoryCat = tb.vstack(ssSourceHistory)
 
 unassociatedSsObjectHistoryCat = tb.vstack(unassociatedSsObjectHistory)
 
 assocResult = self.associator.run(diaSourceHistoryCat, idGenerator=idGenerator)
 
 assocDiaSources
 
 diaObjectTable
 
 assocDiaSourceTable
 

Detailed Description

Pipeline for running DiaSource association in a DRP context.

Function Documentation

◆ _addDiaObjectCoords()

lsst.pipe.tasks.drpAssociationPipe._addDiaObjectCoords ( self,
objects,
sources )
protected

Definition at line 361 of file drpAssociationPipe.py.

361 def _addDiaObjectCoords(self, objects, sources):
362 obj = objects[['ra', 'dec']].rename(columns={"ra": "coord_ra", "dec": "coord_dec"})
363 df = pd.merge(sources.reset_index(), obj, left_on='diaObjectId', right_index=True,
364 how='inner').set_index('diaSourceId')
365 return df
366

◆ _trimToPatch()

lsst.pipe.tasks.drpAssociationPipe._trimToPatch ( self,
cat,
innerPatchBox,
innerTractSkyRegion,
wcs )
protected
Create generator testing if a set of DiaSources are in the
patch/tract.

Parameters
----------
cat : `pandas.DataFrame`
    Catalog of DiaSources to test within patch/tract.
innerPatchBox : `lsst.geom.Box2D`
    Bounding box of the patch.
wcs : `lsst.geom.SkyWcs`
    Wcs of the tract.

Returns
------
isInPatch : `numpy.ndarray`, (N,)
    Booleans representing if the DiaSources are contained within the
    current patch and tract.

Definition at line 367 of file drpAssociationPipe.py.

367 def _trimToPatch(self, cat, innerPatchBox, innerTractSkyRegion, wcs):
368 """Create generator testing if a set of DiaSources are in the
369 patch/tract.
370
371 Parameters
372 ----------
373 cat : `pandas.DataFrame`
374 Catalog of DiaSources to test within patch/tract.
375 innerPatchBox : `lsst.geom.Box2D`
376 Bounding box of the patch.
377 wcs : `lsst.geom.SkyWcs`
378 Wcs of the tract.
379
380 Returns
381 ------
382 isInPatch : `numpy.ndarray`, (N,)
383 Booleans representing if the DiaSources are contained within the
384 current patch and tract.
385 """
386 isInPatch = np.zeros(len(cat), dtype=bool)
387
388 for idx, row in cat.iterrows():
389 spPoint = geom.SpherePoint(row["ra"], row["dec"], geom.degrees)
390 pxCoord = wcs.skyToPixel(spPoint)
391 ra_rad = np.deg2rad(row["ra"])
392 dec_rad = np.deg2rad(row["dec"])
393
394 isInPatch[idx] = innerPatchBox.contains(pxCoord) and innerTractSkyRegion.contains(ra_rad, dec_rad)
395
396 return isInPatch
Point in an unspecified spherical coordinate system.
Definition SpherePoint.h:57

Variable Documentation

◆ assocDiaSources

lsst.pipe.tasks.drpAssociationPipe.assocDiaSources

Definition at line 351 of file drpAssociationPipe.py.

◆ assocDiaSourceTable

lsst.pipe.tasks.drpAssociationPipe.assocDiaSourceTable

Definition at line 356 of file drpAssociationPipe.py.

◆ assocDiaSrcIds

lsst.pipe.tasks.drpAssociationPipe.assocDiaSrcIds = set(associatedSsSources['diaSourceId'])

Definition at line 273 of file drpAssociationPipe.py.

◆ associatedSsDiaSources

lsst.pipe.tasks.drpAssociationPipe.associatedSsDiaSources = ssoAssocResult.ssoAssocDiaSources

Definition at line 267 of file drpAssociationPipe.py.

◆ associatedSsSources

lsst.pipe.tasks.drpAssociationPipe.associatedSsSources = ssoAssocResult.associatedSsSources

Definition at line 266 of file drpAssociationPipe.py.

◆ assocResult

lsst.pipe.tasks.drpAssociationPipe.assocResult = self.associator.run(diaSourceHistoryCat, idGenerator=idGenerator)

Definition at line 345 of file drpAssociationPipe.py.

◆ bbox

lsst.pipe.tasks.drpAssociationPipe.bbox = finalVisitSummary.find(detector).getBBox()

Definition at line 256 of file drpAssociationPipe.py.

◆ diaCat

lsst.pipe.tasks.drpAssociationPipe.diaCat = ssoAssocResult.unAssocDiaSources.to_pandas()

Definition at line 286 of file drpAssociationPipe.py.

◆ diaInTractPatch

lsst.pipe.tasks.drpAssociationPipe.diaInTractPatch
Initial value:
1= self._trimToPatch(diaCat,
2 innerPatchBox,
3 innerTractSkyRegion,
4 skyInfo.wcs)

Definition at line 290 of file drpAssociationPipe.py.

◆ diaObjectTable

lsst.pipe.tasks.drpAssociationPipe.diaObjectTable

Definition at line 355 of file drpAssociationPipe.py.

◆ diaSourceHistoryCat

lsst.pipe.tasks.drpAssociationPipe.diaSourceHistoryCat = pd.concat(diaSourceHistory)

Definition at line 316 of file drpAssociationPipe.py.

◆ diaSrcMask

list lsst.pipe.tasks.drpAssociationPipe.diaSrcMask = [diaId in assocDiaSrcIds for diaId in associatedSsDiaSources['diaSourceId']]

Definition at line 274 of file drpAssociationPipe.py.

◆ nDiaSrc

lsst.pipe.tasks.drpAssociationPipe.nDiaSrc = diaInTractPatch.sum()

Definition at line 296 of file drpAssociationPipe.py.

◆ nSsObj

lsst.pipe.tasks.drpAssociationPipe.nSsObj = ssObjInTractPatch.sum()

Definition at line 284 of file drpAssociationPipe.py.

◆ nSsSrc

lsst.pipe.tasks.drpAssociationPipe.nSsSrc = ssInTractPatch.sum()

Definition at line 283 of file drpAssociationPipe.py.

◆ ssInTractPatch

lsst.pipe.tasks.drpAssociationPipe.ssInTractPatch
Initial value:
1= self._trimToPatch(associatedSsSources.to_pandas(),
2 innerPatchBox,
3 innerTractSkyRegion,
4 skyInfo.wcs)

Definition at line 268 of file drpAssociationPipe.py.

◆ ssoAssocResult

lsst.pipe.tasks.drpAssociationPipe.ssoAssocResult
Initial value:
1= self.solarSystemAssociator.run(
2 tb.Table.from_pandas(diaCat),
3 ssCat,
4 visitInfo,
5 bbox,
6 wcs,
7 )

Definition at line 258 of file drpAssociationPipe.py.

◆ ssObjInTractPatch

lsst.pipe.tasks.drpAssociationPipe.ssObjInTractPatch
Initial value:
1= self._trimToPatch(unassociatedSsObjects.to_pandas(),
2 innerPatchBox,
3 innerTractSkyRegion,
4 skyInfo.wcs)

Definition at line 278 of file drpAssociationPipe.py.

◆ ssSourceHistoryCat

lsst.pipe.tasks.drpAssociationPipe.ssSourceHistoryCat = tb.vstack(ssSourceHistory)

Definition at line 322 of file drpAssociationPipe.py.

◆ unassociatedSsObjectHistoryCat

lsst.pipe.tasks.drpAssociationPipe.unassociatedSsObjectHistoryCat = tb.vstack(unassociatedSsObjectHistory)

Definition at line 328 of file drpAssociationPipe.py.

◆ unassociatedSsObjects

lsst.pipe.tasks.drpAssociationPipe.unassociatedSsObjects = ssoAssocResult.unassociatedSsObjects

Definition at line 277 of file drpAssociationPipe.py.

◆ visitInfo

lsst.pipe.tasks.drpAssociationPipe.visitInfo = finalVisitSummary.find(detector).visitInfo

Definition at line 255 of file drpAssociationPipe.py.

◆ wcs

lsst.pipe.tasks.drpAssociationPipe.wcs = finalVisitSummary.find(detector).wcs

Definition at line 257 of file drpAssociationPipe.py.