LSST Applications g04a91732dc+146a938ab0,g07dc498a13+80b84b0d75,g0fba68d861+4c4f3dcb5c,g1409bbee79+80b84b0d75,g1a7e361dbc+80b84b0d75,g1fd858c14a+f6e422e056,g20f46db602+333b6c0f32,g35bb328faa+fcb1d3bbc8,g42c1b31a95+a1301e4c20,g4d2262a081+f1facf12e5,g4d39ba7253+9b833be27e,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g60b5630c4e+9b833be27e,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+790117df0f,g89139ef638+80b84b0d75,g8d6b6b353c+9b833be27e,g9125e01d80+fcb1d3bbc8,g989de1cb63+80b84b0d75,g9f33ca652e+9c6b68d7f3,ga9baa6287d+9b833be27e,gaaedd4e678+80b84b0d75,gabe3b4be73+1e0a283bba,gb1101e3267+9f3571abad,gb58c049af0+f03b321e39,gb90eeb9370+691e4ab549,gc741bbaa4f+2bcd3860df,gcf25f946ba+790117df0f,gd315a588df+5b65d88fe4,gd6cbbdb0b4+c8606af20c,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+ee6a3faa19,ge278dab8ac+932305ba37,ge82c20c137+76d20ab76d,gee8db133a9+2a6ae0040b,w.2025.10
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
 
 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 358 of file drpAssociationPipe.py.

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

◆ _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 364 of file drpAssociationPipe.py.

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

Variable Documentation

◆ assocDiaSources

lsst.pipe.tasks.drpAssociationPipe.assocDiaSources

Definition at line 348 of file drpAssociationPipe.py.

◆ assocDiaSourceTable

lsst.pipe.tasks.drpAssociationPipe.assocDiaSourceTable

Definition at line 353 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 342 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 284 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 288 of file drpAssociationPipe.py.

◆ diaObjectTable

lsst.pipe.tasks.drpAssociationPipe.diaObjectTable

Definition at line 352 of file drpAssociationPipe.py.

◆ diaSourceHistoryCat

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

Definition at line 314 of file drpAssociationPipe.py.

◆ nDiaSrc

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

Definition at line 294 of file drpAssociationPipe.py.

◆ nSsObj

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

Definition at line 282 of file drpAssociationPipe.py.

◆ nSsSrc

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

Definition at line 281 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 276 of file drpAssociationPipe.py.

◆ ssSourceHistoryCat

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

Definition at line 320 of file drpAssociationPipe.py.

◆ unassociatedSsObjectHistoryCat

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

Definition at line 325 of file drpAssociationPipe.py.

◆ unassociatedSsObjects

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

Definition at line 275 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.