Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0fba68d861+a3ea3d1d86,g1ec0fe41b4+e220e2fb2f,g1fd858c14a+120b017347,g35bb328faa+fcb1d3bbc8,g4d2262a081+bd92cbabc2,g53246c7159+fcb1d3bbc8,g56a49b3a55+8d793c2a3d,g60b5630c4e+4e8d433789,g67b6fd64d1+fad15079a7,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g8180f54f50+65cb53bb37,g8352419a5c+fcb1d3bbc8,g8852436030+ae791ba189,g89139ef638+fad15079a7,g9125e01d80+fcb1d3bbc8,g94187f82dc+4e8d433789,g989de1cb63+fad15079a7,g9ccd5d7f00+cce09d2c12,g9d31334357+4e8d433789,g9f33ca652e+323fd354f8,gabe3b4be73+1e0a283bba,gabf8522325+94c30d56e9,gb1101e3267+5e0f808207,gb58c049af0+f03b321e39,gb89ab40317+fad15079a7,gc0af124501+a88dc73679,gcf25f946ba+ae791ba189,gd6cbbdb0b4+8d7f1baacb,gdb1c4ca869+16879ca1a6,gde0f65d7ad+61e7a18ddf,ge1ad929117+4e8d433789,ge278dab8ac+4d6e48c014,ge35a86080c+6eff471efc,ge410e46f29+fad15079a7,gf5e32f922b+fcb1d3bbc8,gf618743f1b+8ff1364817,gf67bdafdda+fad15079a7,w.2025.17
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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.