diff --git a/pipelines/production/comCamRapidAnalysisPipeline.yaml b/pipelines/production/comCamRapidAnalysisPipeline.yaml index 0c5ba9fce..863821421 100644 --- a/pipelines/production/comCamRapidAnalysisPipeline.yaml +++ b/pipelines/production/comCamRapidAnalysisPipeline.yaml @@ -19,6 +19,7 @@ tasks: config: estimateZernikes.maxNollIndex: 22 estimateZernikes.convergeTol: 10.0e-9 + estimateZernikes.requireConverge: True estimateZernikes.saveHistory: False estimateZernikes.maskKwargs: { "doMaskBlends": False } donutStampSelector.maxSelect: 5 diff --git a/python/lsst/ts/wep/estimation/tie.py b/python/lsst/ts/wep/estimation/tie.py index 4f962e2aa..80058ea53 100644 --- a/python/lsst/ts/wep/estimation/tie.py +++ b/python/lsst/ts/wep/estimation/tie.py @@ -99,7 +99,7 @@ class TieAlgorithm(WfAlgorithm): requireConverge : bool, optional Whether to require that the TIE converges. If True, and the TIE did not converge, the TIE returns NaNs. - (the default is True) + (the default is False) """ def __init__( @@ -114,7 +114,7 @@ def __init__( maskKwargs: Optional[dict] = None, modelPupilKernelSize: float = 2, binning: int = 1, - requireConverge: bool = True, + requireConverge: bool = False, ) -> None: self.opticalModel = opticalModel self.maxIter = maxIter diff --git a/python/lsst/ts/wep/task/estimateZernikesTieTask.py b/python/lsst/ts/wep/task/estimateZernikesTieTask.py index d3b631cdc..1069f744f 100644 --- a/python/lsst/ts/wep/task/estimateZernikesTieTask.py +++ b/python/lsst/ts/wep/task/estimateZernikesTieTask.py @@ -112,7 +112,7 @@ class EstimateZernikesTieConfig(EstimateZernikesBaseConfig): ) requireConverge = pexConfig.Field( dtype=bool, - default=True, + default=False, doc="Whether to require that the TIE converges. " + "If True, and the TIE did not converge, the TIE returns NaNs. ", ) diff --git a/tests/task/test_calcZernikesTieTaskCwfs.py b/tests/task/test_calcZernikesTieTaskCwfs.py index 3005f82bd..19e8f3511 100644 --- a/tests/task/test_calcZernikesTieTaskCwfs.py +++ b/tests/task/test_calcZernikesTieTaskCwfs.py @@ -112,6 +112,9 @@ def testValidateConfigs(self): self.assertEqual(type(self.task.combineZernikes), CombineZernikesMeanTask) + self.config.estimateZernikes.binning = 2 + self.assertEqual(self.task.estimateZernikes.wfAlgoConfig.binning, 2) + def testEstimateZernikes(self): zernCoeff = self.task.estimateZernikes.run( self.donutStampsExtra, self.donutStampsIntra @@ -281,3 +284,23 @@ def testUnevenPairs(self): # Now estimate Zernikes self.task.run(stampsExtra, stampsIntra) + + def testRequireConverge(self): + config = CalcZernikesTaskConfig() + config.estimateZernikes.requireConverge = True # Require to converge + config.estimateZernikes.convergeTol = 0 # But don't allow convergence + task = CalcZernikesTask(config=config, name="Test requireConverge") + + # Estimate zernikes + donutStampDir = os.path.join(self.testDataDir, "donutImg", "donutStamps") + donutStampsExtra = DonutStamps.readFits( + os.path.join(donutStampDir, "R04_SW0_donutStamps.fits") + ) + donutStampsIntra = DonutStamps.readFits( + os.path.join(donutStampDir, "R04_SW1_donutStamps.fits") + ) + output = task.estimateZernikes.run(donutStampsExtra, donutStampsIntra) + zernikes = output.zernikes + + # Everything should be NaN because we did not converge + self.assertTrue(np.isnan(zernikes).all())