diff --git a/doc/versionHistory.rst b/doc/versionHistory.rst index b6604154..5293323e 100644 --- a/doc/versionHistory.rst +++ b/doc/versionHistory.rst @@ -6,6 +6,14 @@ Version History ################## +.. _lsst.ts.wep-13.3.0: + +------------- +13.3.0 +------------- + +* Add donut quality tables to outputs even when there are no donuts that pass so that we can match it up to the donut stamps and understand rejections. + .. _lsst.ts.wep-13.2.0: ------------- diff --git a/python/lsst/ts/wep/task/calcZernikesTask.py b/python/lsst/ts/wep/task/calcZernikesTask.py index b0990fc4..141f5f51 100644 --- a/python/lsst/ts/wep/task/calcZernikesTask.py +++ b/python/lsst/ts/wep/task/calcZernikesTask.py @@ -346,8 +346,10 @@ def createZkTable( return zkTable - def empty(self) -> pipeBase.Struct: - """Return empty results if no donuts are available.""" + def empty(self, qualityTable=None) -> pipeBase.Struct: + """Return empty results if no donuts are available. If + it is a result of no quality donuts we still include the + quality table results instead of an empty quality table.""" qualityTableCols = [ "SN", "ENTROPY", @@ -356,11 +358,15 @@ def empty(self) -> pipeBase.Struct: "FINAL_SELECT", "DEFOCAL_TYPE", ] + if qualityTable is None: + donutQualityTable = QTable({name: [] for name in qualityTableCols}) + else: + donutQualityTable = qualityTable return pipeBase.Struct( outputZernikesRaw=np.atleast_2d(np.full(len(self.nollIndices), np.nan)), outputZernikesAvg=np.atleast_2d(np.full(len(self.nollIndices), np.nan)), zernikes=self.initZkTable(), - donutQualityTable=QTable({name: [] for name in qualityTableCols}), + donutQualityTable=donutQualityTable, ) @timeMethod @@ -396,7 +402,7 @@ def run( or len(selectionIntra.donutStampsSelect) == 0 ): self.log.info("No donut stamps were selected.") - return self.empty() + return self.empty(qualityTable=donutQualityTable) else: donutQualityTable = QTable([])