Skip to content

Commit

Permalink
Add qualityTables when no donuts pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkalmbach committed Dec 11, 2024
1 parent 144e8fe commit 6567c1c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
8 changes: 8 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

-------------
Expand Down
14 changes: 10 additions & 4 deletions python/lsst/ts/wep/task/calcZernikesTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down Expand Up @@ -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([])

Expand Down

0 comments on commit 6567c1c

Please sign in to comment.