Skip to content

Commit

Permalink
Add configurable limit on the number of streak fitting iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Dec 9, 2024
1 parent 36fd315 commit 1f24fba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/lsst/meas/algorithms/maskStreaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@ class MaskStreaksConfig(pexConfig.Config):
dtype=float,
default=0.1
)
maxFitIter = pexConfig.Field(
doc="Maximum number of line profile fitting iterations that is "
"acceptable for convergence",
dtype=int,
default=100
)
detectedMaskPlane = pexConfig.Field(
doc="Name of mask with pixels above detection threshold, used for first"
"estimate of streak locations",
Expand Down Expand Up @@ -757,7 +763,8 @@ def _fitProfile(self, lines, maskedImage):
if lineModel.lineMaskSize == 0:
continue

fit, fitFailure = lineModel.fit(dChi2Tol=self.config.dChi2Tolerance, log=self.log)
fit, fitFailure = lineModel.fit(dChi2Tol=self.config.dChi2Tolerance, log=self.log,
maxIter=self.config.maxFitIter)

# Initial estimate should be quite close: fit is deemed unsuccessful if rho or theta
# change more than the allowed bin in rho or theta:
Expand Down

0 comments on commit 1f24fba

Please sign in to comment.