Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: jointcal
-
Labels:
-
Story Points:2
-
Epic Link:
-
Sprint:AP S21-6 (May), AP F21-1 (June)
-
Team:Alert Production
-
Urgent?:No
Description
While investigating DM-30252, Clare Saunders and I re-discovered a C++ crash in jointcal-that she had noticed during previous testing-when fitting only the model with outlier rejection turned on. FitterBase::findOutliers cannot mark parameters as changed if those parameters are outside the portion of the matrix being fit (i.e. if _nParTot does not include _nParPositions). The simplest fix for this is to not reject outliers that are not being fit; they are not directly contributing to the fit chisq anyway!
On this ticket I added Associations.cleanFittedStars(), which removes FittedStars that have no measuredStars, but I don't actually use it anywhere here. A use case would be to change the existing _iterate_fit() call in _fit_astrometry to only fit "Distortions" and add the below immediately after. That may or may not actually help with runtime, but might "finalize" the positions after we get much closer by only fitting the model.
associations.cleanFittedStars()
chi2 = self._iterate_fit(associations,
fit,
1, # only do one "outer" fit loop to finalize positions
"astrometry",
"DistortionsPositions",
doRankUpdate=self.config.astrometryDoRankUpdate,
dataName=dataName)
Alternately, you could do this at the same place, which wouldn't remove FittedStar/RefStar outliers, but would also "finalize" the positions:
associations.cleanFittedStars()
fit.minimize("DistortionsPositions")
self._logChi2AndValidate(associations, fit, model, "Finalize DistortionsPositions",
writeChi2Name=getChi2Name("FinalDistortionsPositions"))