Another concern is that this problem went undetected for an unknown amount of time. This is because the tests using this static version of phosim images are too porous, and empty donut stamps did not make the tests fail.
For instance, test_calcZernikesTaskCwfs.py passes because :
- testEstimateZernikes only checks if there's 19 Zks, and there is, even we pass two empty donut stamps
- testEstimateCornerZernikes uses pre-computed R04_SW0_donutStamps.fits which are not a result of running the pipeline that includes generateDonutCatalogWcsTask
- testGetCombinedZernikes again only checks if there's 19 Zernikes, but not if they make any sense
Similarly, test_estimateZernikesCwfsTask.py passes because:
- testTaskRunNormal /testTaskRunNormal only checks if running the task in real time) contains the same donut stamps / Zernikes as when reading from butler the results of running the task as a pipetask - it doesn't test if they make sense. Empty donut stamps pass this test.
But this should be addressed as a new ticket.
Running imgCloseLoop with the existing `skyRefCat` as the instance catalog in phosimDir (slightly modified to allow for the ra range recognized by phosim: from 0:360 to -180:180 degrees) and substituting the fits files in ts_wep/tests/testData/phosimOutput/realWfs/output with those of phosimDir/iter0/img/wfs/ fixes the issue: running again content of test_cutOutDonutsCwfsTask we see that now sources are where they are expected to be, so that no donut stamps are empty (based on the WCS information):