PlotDiaSourceLightcurveTask#
- class lsst.analysis.ap.PlotDiaSourceLightcurveTask(*, output_path, apdb_query=None, **kwargs)#
Bases:
PlotImageSubtractionCutoutsTaskGenerate cutouts plus a diaObject lightcurve panel for each diaSource.
Parameters#
- output_path
str Path to write outputs to. Same convention as the parent task.
- apdb_query
lsst.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
dataDataFrame must include the fields required by the parent (ra, dec, diaSourceId, detector, visit, instrument) plusdiaObjectId(to load the lightcurve) andmidpointMjdTai(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#
- data
pandas.DataFrame The DiaSources to extract cutouts for. Must contain at least these fields:
ra, dec, diaSourceId, detector, visit, instrument.- butler
lsst.daf.butler.Butler The butler connection to use to load the data; create it with the collections you wish to load images from.
- njobs
int, optional Number of multiprocessing jobs to make cutouts with; default of 0 means don’t use multiprocessing at all.
Returns#
- source_ids
list[int] DiaSourceIds of cutout images that were generated.
- data
- write_images(data, butler, njobs=0)#
Make the 3-part cutout images for each requested source and write them to disk.
Creates
images/andnumpy/subdirectories if they do not already exist; images are written there as PNG and npy files.Parameters#
- data
pandas.DataFrame The DiaSources to extract cutouts for. Must contain at least these fields:
ra, dec, diaSourceId, detector, visit, instrument.- butler
lsst.daf.butler.Butler The butler connection to use to load the data; create it with the collections you wish to load images from.
- njobs
int, optional Number of multiprocessing jobs to make cutouts with; default of 0 means don’t use multiprocessing at all.
Returns#
- sources
list DiaSourceIds that had cutouts made.
- data
- output_path