diff --git a/python/lsst/ts/wep/task/calcZernikesTask.py b/python/lsst/ts/wep/task/calcZernikesTask.py index 141f5f51..6c3fc0b3 100644 --- a/python/lsst/ts/wep/task/calcZernikesTask.py +++ b/python/lsst/ts/wep/task/calcZernikesTask.py @@ -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", diff --git a/tests/task/test_calcZernikesTieTaskScienceSensor.py b/tests/task/test_calcZernikesTieTaskScienceSensor.py index fa6575dc..3c1d4c1c 100644 --- a/tests/task/test_calcZernikesTieTaskScienceSensor.py +++ b/tests/task/test_calcZernikesTieTaskScienceSensor.py @@ -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))