ApdbReconstructor#
- class lsst.analysis.ap.ApdbReconstructor(butler, dataset_names=None, *, collections=None, where=None)#
Bases:
objectReconstruct APDB-shaped catalogs from
DiaPipelineTaskbutler outputs.Parameters#
- butler
lsst.daf.butler.Butler Butler initialized with the collections that hold the pipeline run.
- dataset_names
dict[str,list[str]], optional Override the default dataset types used for each table. Keys are
"diaSource","diaObject","diaForcedSource"; each value is a list of dataset-type names that get concatenated and deduplicated. Defaults toDEFAULT_DATASET_NAMES, which includes thepreloaded_*datasets so the reconstruction includes both “history” rows from preload and the new ones.- collections
list[str], optional Specify the butler collections to query if not using the default configured for the butler.
- where
str, optional Butler
whereclause passed through toqueryDatasets(e.g."instrument='LSSTComCam' AND visit > 1000").
Attributes Summary
Methods Summary
finalize(diaSources, diaObjects, ...[, ...])Dedup and (optionally) schema-coerce already-loaded catalogs.
reconstruct(*[, coerce_to_schema, history])Load all per-quantum catalogs and return APDB-shaped DataFrames.
to_query(*[, coerce_to_schema, history])Reconstruct and wrap the result as a
DbQuery-compatible adapter so the in-memory frames can be passed tolightcurve,PlotDiaSourceLightcurveTask, and other tools that expect theDbQueryinterface.Attributes Documentation
- DEFAULT_DATASET_NAMES = {'diaForcedSource': ['dia_forced_source_apdb', 'preloaded_dia_forced_source'], 'diaObject': ['dia_object_apdb', 'preloaded_dia_object'], 'diaSource': ['dia_source_apdb', 'preloaded_dia_source']}#
Methods Documentation
- static finalize(diaSources, diaObjects, diaForcedSources, *, coerce_to_schema=True, history=False)#
Dedup and (optionally) schema-coerce already-loaded catalogs.
Parameters#
- diaSources, diaObjects, diaForcedSources
pandas.DataFrame Concatenated per-quantum catalogs.
coerce_to_schema, history : see
reconstruct.Returns#
result :
ApdbReconstruction- diaSources, diaObjects, diaForcedSources
- reconstruct(*, coerce_to_schema=True, history=False)#
Load all per-quantum catalogs and return APDB-shaped DataFrames.
Parameters#
- coerce_to_schema
bool, optional If True (default), coerce each output to the SDM
apdb.yamlschema.- history
bool, optional If True, keep every diaObject row written across all quanta. If False (default), dedupe to the atest row per
diaObjectId, mirroring the “current APDB state” view thatDiaObjectLastwould give.
Returns#
result :
ApdbReconstruction- coerce_to_schema
- to_query(*, coerce_to_schema=True, history=False)#
Reconstruct and wrap the result as a
DbQuery-compatible adapter so the in-memory frames can be passed tolightcurve,PlotDiaSourceLightcurveTask, and other tools that expect theDbQueryinterface.Returns#
query :
InMemoryDbQuery
- butler