find_objects_sharing_sources#
- lsst.analysis.ap.find_objects_sharing_sources(diaObjectId, sources1, sources2, objects1, objects2, max_distance_arcsec=2, match_radius=0.5)#
For a diaObjectId in run 1, return the full association cluster of diaSources and diaObjects from both runs.
Treats the (diaSource, run-1-diaObject, run-2-diaObject) links as a graph – each diaSource is connected to its owning diaObject in each run – and grows the connected component reachable from the input diaObjectId until no new sources or objects are discovered. Catches arbitrarily deep merge/split chains across the two runs (e.g. run 2 merges A+B into Z, then a third source in B is split into a fourth object in run 2, etc.).
diaSourceIds are not stable across runs (they end in a per-catalog counter assigned in detection order), so the two runs’ diaSources are paired by position via
_match_source_ids. Only detections present in both runs carry the graph; a diaSource with no counterpart withinmatch_radiuscannot link objects across runs.Parameters#
- diaObjectId
int A diaObjectId, typically from
unique1returned bycompare_objects.- sources1, sources2
pandas.DataFrame Full diaSources catalogs from runs 1 and 2 (e.g. from
query.load_sources()). Each must containdiaSourceId,diaObjectId,ra, anddeccolumns.- objects1, objects2
pandas.DataFrame Full diaObjects catalogs from runs 1 and 2 (e.g. from
query.load_objects()). Each must containdiaObjectId,ra, anddeccolumns.- max_distance_arcsec
float, optional If given, only include diaSources within this distance of the input diaObject’s (ra, dec) in the search. All diaSources of the final diaObjects will still be returned, even if outside this distance.
- match_radius
float, optional Maximum separation in arcsec for a run-1 and a run-2 diaSource to be treated as the same detection.
Returns#
- sources
pandas.DataFrame Rows of
sources1for every diaSource belonging to any of the found run-2 diaObjects (in run 2’s view).- related_objects1
pandas.DataFrame Rows of
objects1for every run-1 diaObject containing any of those diaSources in run 1.- related_objects2
pandas.DataFrame Rows of
objects2for every run-2 diaObject containing any of those diaSources in run 2.
- diaObjectId