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 within match_radius cannot link objects across runs.

Parameters#

diaObjectIdint

A diaObjectId, typically from unique1 returned by compare_objects.

sources1, sources2pandas.DataFrame

Full diaSources catalogs from runs 1 and 2 (e.g. from query.load_sources()). Each must contain diaSourceId, diaObjectId, ra, and dec columns.

objects1, objects2pandas.DataFrame

Full diaObjects catalogs from runs 1 and 2 (e.g. from query.load_objects()). Each must contain diaObjectId, ra, and dec columns.

max_distance_arcsecfloat, 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_radiusfloat, optional

Maximum separation in arcsec for a run-1 and a run-2 diaSource to be treated as the same detection.

Returns#

sourcespandas.DataFrame

Rows of sources1 for every diaSource belonging to any of the found run-2 diaObjects (in run 2’s view).

related_objects1pandas.DataFrame

Rows of objects1 for every run-1 diaObject containing any of those diaSources in run 1.

related_objects2pandas.DataFrame

Rows of objects2 for every run-2 diaObject containing any of those diaSources in run 2.