23 """Pipeline for computing DiaObject summary/light curve values.
26 __all__ = [
"DrpDiaCalculationPipeTask",
27 "DrpDiaCalculationPipeConfig",
28 "DrpDiaCalculationPipeConnections"]
38 dimensions=(
"tract",
"patch",
"skymap"),
39 defaultTemplates={
"coaddName":
"deep",
41 assocDiaSourceTable = pipeBase.connectionTypes.Input(
42 doc=
"Catalog of DiaSources covering the patch and associated with a "
44 name=
"{fakesType}{coaddName}Diff_assocDiaSrcTable",
45 storageClass=
"DataFrame",
46 dimensions=(
"tract",
"patch"),
48 diaObjectTable = pipeBase.connectionTypes.Input(
49 doc=
"Catalog of DiaObjects created from spatially associating "
51 name=
"{fakesType}{coaddName}Diff_diaObjTable",
52 storageClass=
"DataFrame",
53 dimensions=(
"tract",
"patch"),
55 fullDiaObjectTable = pipeBase.connectionTypes.Output(
56 doc=
"Catalog of DiaObjects created from spatially associating "
58 name=
"{fakesType}{coaddName}Diff_fullDiaObjTable",
59 storageClass=
"DataFrame",
60 dimensions=(
"tract",
"patch"),
64 class DrpDiaCalculationPipeConfig(
65 pipeBase.PipelineTaskConfig,
66 pipelineConnections=DrpDiaCalculationPipeConnections):
67 filterNames = pexConfig.ListField(
69 default=[
'u',
'g',
'r',
'i',
'z',
'y'],
70 doc=
"List of filters to attempt to calculate DiaObject summary "
73 diaCalculation = pexConfig.ConfigurableField(
74 target=DiaObjectCalculationTask,
75 doc=
"Task to compute summary statistics for DiaObjects.",
78 def setDefaults(self):
79 self.diaCalculation.plugins = [
"ap_meanPosition",
96 class DrpDiaCalculationPipeTask(pipeBase.PipelineTask):
97 """Driver pipeline for loading DiaSource catalogs in a patch/tract
98 region and associating them.
100 ConfigClass = DrpDiaCalculationPipeConfig
101 _DefaultName =
"drpDiaCalculation"
103 def __init__(self, **kwargs):
104 super().__init__(**kwargs)
105 self.makeSubtask(
"diaCalculation")
107 def run(self, assocDiaSourceTable, diaObjectTable):
108 """Compute summary statistics over the input set of DiaSources and
109 store summary statistics into the associated DiaObjects.
113 assocDiaSourceTable : `pandas.DataFrame`
114 Set of DiaSources spatially associated into the DiaObjects in
116 diaObjectTable : `pandas.DataFrame`
117 DiaObjects created from associating the sources in
118 ``assocDiaSourceTable``. All ids in the catalog must have a
119 corresponding DiaSource in the input catalog.
123 results : `lsst.pipe.base.Struct`
126 ``fullDiaObjectTable``
127 DiaObjects with computed summary statistics based on their
128 associated DiaSource light curves. (`pandas.DataFrame`).
131 if len(diaObjectTable) <= 0
or len(assocDiaSourceTable) <= 0:
132 return pipeBase.Struct(fullDiaObjectTable=pd.DataFrame())
133 result = self.diaCalculation.run(
136 diaObjectTable.index.to_numpy(),
137 self.config.filterNames)
138 return pipeBase.Struct(fullDiaObjectTable=result.updatedDiaObjects)