Skip to content

Commit

Permalink
Add test for new donutQualityTable behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkalmbach committed Dec 11, 2024
1 parent 6567c1c commit d0dc9c3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 14 additions & 1 deletion python/lsst/ts/wep/task/calcZernikesTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,20 @@ def createZkTable(
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."""
quality table results instead of an empty quality table.
Parameters
----------
qualityTable : astropy.table.QTable
Quality table created with donut stamp input.
Returns
-------
lsst.pipe.base.Struct
Empty output tables for zernikes. Empty quality table
if no donuts. Otherwise contains quality table
with donuts that all failed to pass quality check.
"""
qualityTableCols = [
"SN",
"ENTROPY",
Expand Down
7 changes: 7 additions & 0 deletions tests/task/test_calcZernikesTieTaskScienceSensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ def testCalcZernikes(self):
self.assertIsInstance(struct.outputZernikesRaw, np.ndarray)
self.assertIsInstance(struct.outputZernikesAvg, np.ndarray)
self.assertIsInstance(struct.zernikes, QTable)
self.assertEqual(len(structNormal.donutQualityTable), 6)
self.assertEqual(len(structNull.donutQualityTable), 0)

self.config.donutStampSelector.maxSelect = 0
self.task = CalcZernikesTask(config=self.config)
structAllDonutsFail = self.task.run(donutStampsIntra, donutStampsExtra)
self.assertEqual(len(structAllDonutsFail.donutQualityTable), 6)

def testGetCombinedZernikes(self):
testArr = np.zeros((2, 19))
Expand Down

0 comments on commit d0dc9c3

Please sign in to comment.