LSST Applications g013ef56533+d2224463a4,g199a45376c+0ba108daf9,g19c4beb06c+9f335b2115,g1fd858c14a+2459ca3e43,g210f2d0738+2d3d333a78,g262e1987ae+abbb004f04,g2825c19fe3+eedc38578d,g29ae962dfc+0cb55f06ef,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+19c3a54948,g47891489e3+501a489530,g4cdb532a89+a047e97985,g511e8cfd20+ce1f47b6d6,g53246c7159+8c5ae1fdc5,g54cd7ddccb+890c8e1e5d,g5fd55ab2c7+951cc3f256,g64539dfbff+2d3d333a78,g67b6fd64d1+501a489530,g67fd3c3899+2d3d333a78,g74acd417e5+0ea5dee12c,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+501a489530,g8d7436a09f+5ea4c44d25,g8ea07a8fe4+81eaaadc04,g90f42f885a+34c0557caf,g9486f8a5af+165c016931,g97be763408+d5e351dcc8,gbf99507273+8c5ae1fdc5,gc2a301910b+2d3d333a78,gca7fc764a6+501a489530,gce8aa8abaa+8c5ae1fdc5,gd7ef33dd92+501a489530,gdab6d2f7ff+0ea5dee12c,ge410e46f29+501a489530,geaed405ab2+e3b4b2a692,gf9a733ac38+8c5ae1fdc5,w.2025.41
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.