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#
- butler1
lsst.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.
- butler2
lsst.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.
- query1
lsst.analysis.ap.DbQuery DbQuery to first APDB (postgresql or slite file; NOT created in this function).
- query2
lsst.analysis.ap.DbQuery DbQuery to second APDB (postgresql or slite file; NOT created in this function).
- bad_flag_list
list, optional List of bad flags to exclude (applied to both query1 and query2). Omit list to skip filtering.
- match_radius
double Maximum allowable distance in arcsec between an object in data1 and data2.
- make_cutouts
bool, 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_path2
str, optional Base path to store cutouts for sources unique to the datasets. Must be supplied if make_cutouts is True.
- cutout_config1, cutout_config2
dict[str], optional Config overrides to apply to cutout plotter for the datasets. See
PlotImageSubtractionCutoutsConfigfor available options.- njobs
int, optional Number of parallel processes for plotImageSubtractionCutouts.
Returns#
- unique1
pandas.DataFrame Data frame of sources only found in the first dataset.
- unique2
pandas.DataFrame Data frame of sources only found in the second dataset.
- matched
pandas.DataFrame Data frame of matched sources; the rows are sources from the first dataset, with two columns added:
src2_diaSourceIdpointing to the matched diaSourceId in the second dataset, andxmatch_dist_arcsecgiving the on-sky separation in arcseconds.
- butler1