PlotDiaSourceLightcurveTask#

class lsst.analysis.ap.PlotDiaSourceLightcurveTask(*, output_path, apdb_query=None, **kwargs)#

Bases: PlotImageSubtractionCutoutsTask

Generate cutouts plus a diaObject lightcurve panel for each diaSource.

Parameters#

output_pathstr

Path to write outputs to. Same convention as the parent task.

apdb_querylsst.analysis.ap.apdb.DbQuery, optional

Query handle used to load the diaSource and diaForcedSource history for each diaObject. If None, the lightcurve panel is rendered with a placeholder message.

Notes#

The input data DataFrame must include the fields required by the parent (ra, dec, diaSourceId, detector, visit, instrument) plus diaObjectId (to load the lightcurve) and midpointMjdTai (to highlight the current source on the lightcurve).

Methods Summary

run(data, butler[, njobs])

Generate cutout images and a manifest for upload to Zooniverse from a collection of DiaSources.

write_images(data, butler[, njobs])

Make the 3-part cutout images for each requested source and write them to disk.

Methods Documentation

run(data, butler, njobs=0)#

Generate cutout images and a manifest for upload to Zooniverse from a collection of DiaSources.

Parameters#

datapandas.DataFrame

The DiaSources to extract cutouts for. Must contain at least these fields: ra, dec, diaSourceId, detector, visit, instrument.

butlerlsst.daf.butler.Butler

The butler connection to use to load the data; create it with the collections you wish to load images from.

njobsint, optional

Number of multiprocessing jobs to make cutouts with; default of 0 means don’t use multiprocessing at all.

Returns#

source_idslist [int]

DiaSourceIds of cutout images that were generated.

write_images(data, butler, njobs=0)#

Make the 3-part cutout images for each requested source and write them to disk.

Creates images/ and numpy/ subdirectories if they do not already exist; images are written there as PNG and npy files.

Parameters#

datapandas.DataFrame

The DiaSources to extract cutouts for. Must contain at least these fields: ra, dec, diaSourceId, detector, visit, instrument.

butlerlsst.daf.butler.Butler

The butler connection to use to load the data; create it with the collections you wish to load images from.

njobsint, optional

Number of multiprocessing jobs to make cutouts with; default of 0 means don’t use multiprocessing at all.

Returns#

sourceslist

DiaSourceIds that had cutouts made.