compare_sources#

lsst.analysis.ap.compare_sources(butler1, butler2, query1, query2, bad_flag_list=None, match_radius=0.5, make_cutouts=False, display_cutouts=False, cutout_path1=None, cutout_path2=None, cutout_config1=None, cutout_config2=None, njobs=0)#

Compare two APDB datasets by extracting unassociated sources, spatially crossmatching, and plotting cutouts of the differences.

Parameters#

butler1lsst.daf.butler

Initialized Butler repo containing the first dataset. Could be the same as butler2 but should be initialized with the appropriate collection name for cutout generation, if doing that.

butler2lsst.daf.butler

Initialized Butler repo containing the second dataset. Could be the same as butler1 but should be initialized with the appropriate collection name for cutout generation, if doing that.

query1lsst.analysis.ap.DbQuery

DbQuery to first APDB (postgresql or slite file; NOT created in this function).

query2lsst.analysis.ap.DbQuery

DbQuery to second APDB (postgresql or slite file; NOT created in this function).

bad_flag_listlist, optional

List of bad flags to exclude (applied to both query1 and query2). Omit list to skip filtering.

match_radiusdouble

Maximum allowable distance in arcsec between an object in data1 and data2.

make_cutoutsbool, optional

Generate cutouts for sources unique to each dataset; default is False.

display_cutouts: bool, optional

Display cutouts for sources present in only one of the DBs to the screen; default is False.

cutout_path1, cutout_path2str, optional

Base path to store cutouts for sources unique to the datasets. Must be supplied if make_cutouts is True.

cutout_config1, cutout_config2dict [str], optional

Config overrides to apply to cutout plotter for the datasets. See PlotImageSubtractionCutoutsConfig for available options.

njobsint, optional

Number of parallel processes for plotImageSubtractionCutouts.

Returns#

unique1pandas.DataFrame

Data frame of sources only found in the first dataset.

unique2pandas.DataFrame

Data frame of sources only found in the second dataset.

matchedpandas.DataFrame

Data frame of matched sources; the rows are sources from the first dataset, with two columns added: src2_diaSourceId pointing to the matched diaSourceId in the second dataset, and xmatch_dist_arcsec giving the on-sky separation in arcseconds.