lsst.analysis.ap#

This package contains scripts and pipelines to compute quality assurance metrics and make plots to study the output products of the alerts pipeline.

Using lsst.analysis.ap#

Contributing#

lsst.analysis.ap is developed at lsst/analysis_ap. You can find Jira issues for this module under the analysis_ap component.

Task reference#

Tasks#

Script reference#

Python API reference#

lsst.analysis.ap Package#

Functions#

band_color(band[, default])

Return the official Rubin plotting color for a band.

classify_association_clusters(sources1, sources2)

Enumerate and classify every association-disagreement cluster between two APDBs that share input diaSources.

collect_task_runtimes(butler, collections[, ...])

Per-task runtime and memory summary for a butler run collection.

compare_objects(query1, query2[, match_radius])

Compare two APDB datasets by spatially crossmatching diaObjects.

compare_sources(butler1, butler2, query1, query2)

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

cutout_grid(sources, butler, instrument[, ...])

Render science/template/difference cutouts for many sources in a grid.

display_coadd_coverage(butler, visit, detector)

Display a difference image alongside every coadd patch that went into its template.

display_footprints([butler, visit, ...])

Overlay diaSource footprints on an exposure in Firefly, color-cycled so that touching footprints get distinct colors.

display_images(butler, visit, detector[, ...])

Display the science, template, and difference images for a given visit+detector with diagnostic catalog markers overlaid.

display_images_ab(butler_a, butler_b, visit, ...)

Display one image type side-by-side from two butlers, with overlays.

extract_timestamped_messages(log)

Extract records[*].(asctime, message) from an LSST-style JSON log and format them one per line, as.

find_objects_sharing_sources(diaObjectId, ...)

For a diaObjectId in run 1, return the full association cluster of diaSources and diaObjects from both runs.

flux_residuals(matched, srcs2[, flux_col, ...])

Compute per-pair flux residuals from a match_catalogs result.

get_xy_from_source_table(table, wcs[, degrees])

Convert ra/dec coordinates in an astropy table/pandas data frame to pixel x/y positions.

image_diff_stats(butler, visit, detector[, ...])

Summary statistics on a single difference image.

image_diff_stats_table(butler, data_ids[, ...])

Run image_diff_stats over many data ids and return a DataFrame.

lightcurve(query, dia_object_id[, ax, ...])

Plot a per-band psfFlux light curve for one diaObject.

make_simbad_link(ra, dec[, radius_arcsec])

Search Simbad for associated sources within a 3 arcsecond region.

match_catalogs(srcs1, srcs2[, radius, on, ...])

Spatially cross-match two DiaSource-like DataFrames.

match_to_truth(srcs, truth[, radius, ...])

Match a detected catalog against a truth/injection catalog.

pixel_compare(butler1, butler2, visit, detector)

Compare two difference images for the same data id, pixel by pixel.

plot_cutouts_with_object_markers(sources, ...)

Plot per-diaSource cutouts with overlaid markers at given diaObject sky positions.

plot_objects_sharing_sources(diaObjectId, ...)

Two-column cutout figure comparing the run-1 and run-2 views of an association cluster.

region_from_exposure(exposure[, padding])

Compute a cone (ra, dec, radius) covering an exposure's sky footprint.

subtraction_quality_report(metrics[, ...])

Print a headline metric summary and build the diagnostic plot.

summarize_run(query[, bad_flag_list])

Return a per-visit summary DataFrame for an APDB run.

Classes#

ApdbPostgresQuery(namespace[, url, instrument])

Connect to a running postgres APDB instance and load data from it.

ApdbReconstruction(diaSources, diaObjects, ...)

APDB-shaped DataFrames reconstructed from DiaPipelineTask outputs.

ApdbReconstructor(butler[, dataset_names, ...])

Reconstruct APDB-shaped catalogs from DiaPipelineTask butler outputs.

ApdbSqliteQuery(filename[, instrument])

Open an sqlite3 APDB file to load data from it.

CutoutPath(root[, chunk_size, subdirectory])

Manage paths to image cutouts with filenames based on diaSourceId.

DbCassandraQuery(config_uri, *[, instrument])

Implementation of DbQuery interface for Cassandra backend.

DbQuery()

Abstract interface for APDB queries.

DiaObjectLightCurve(diaObjectId, dia_object, ...)

The full PPDB record for a single diaObject.

PlotDiaSourceLightcurveConfig(*args, **kw)

PlotDiaSourceLightcurveTask(*, output_path)

Generate cutouts plus a diaObject lightcurve panel for each diaSource.

PlotImageSubtractionCutoutsConfig(*args, **kw)

PlotImageSubtractionCutoutsTask(*, ...)

Generate template/science/difference image cutouts of DiaSources and an optional manifest for upload to a Zooniverse project.

PpdbTap([url, token, service, log])

Load PPDB catalogs through the RSP TAP service as astropy Tables.