get_template_inputs#
- lsst.analysis.ap.get_template_inputs(butler, dia_sources, *, instrument=None, template_dataset='template_detector')#
Find the observation times and weights of the images that make up the template at the position of each diaSource.
Parameters#
- butler
lsst.daf.butler.Butler Butler with the templates and the coadds they were built from. Coadds are found by dataset ID, so their collections need not be searched.
- dia_sources
astropy.table.Tableorpandas.DataFrame DiaSources, with columns
diaSourceId,visit,detector,ra,dec(degrees) andx,y(science image pixels).- instrument
str, optional Instrument name, if the butler has no default.
- template_dataset
str, optional Template dataset type; must be an
lsst.images.DifferenceImage.
Returns#
- inputs
astropy.table.Table One row per (diaSource, template coadd, input image), with columns:
diaSourceId,visit,detectorThe diaSource and its science image.
tract,patchTemplate coadd the input contributed through.
input_visit,input_detectorThe input image.
mid_mjd_taiMid-exposure time of the input (MJD, TAI);
nanif unknown.exposure_timeExposure time of the input (s);
nanif unknown.coadd_weightWeight of the input as recorded by the coadd.
weightFraction of the template flux at the diaSource that came from this input through this coadd. These sum to 1 for each diaSource; an input in several overlapping coadds has one row for each.
Raises#
- TypeError
Raised if
template_datasethas notemplatescomponent (a legacy Exposure), or if a coadd has no known provenance component.- LookupError
Raised if a template coadd is missing from the butler.
Notes#
The weights are evaluated at the diaSource position only. Warping the template and PSF matching both mix in nearby template pixels, which can come from other coadds or inputs; that is not modeled. Per-pixel input rejection (masked pixels, or artifacts clipped by
lsst.drp.tasks.assemble_coadd.CompareWarpAssembleCoaddTask) is not recorded in coadd provenance, so a rejected input is still reported.- butler