Skip to content

Commit

Permalink
Merge branch 'tickets/DM-34922'
Browse files Browse the repository at this point in the history
  • Loading branch information
plazas committed May 26, 2022
2 parents af4deb6 + ad808bd commit e0f8453
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/lsst/cp/pipe/ptc/cpSolvePtcTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ def errFunc(p, x, y):
goodPoints = self._getInitialGoodPoints(meanVecOriginal, varVecOriginal,
self.config.minVarPivotSearch,
self.config.consecutivePointsVarDecreases)

# Check if all points are bad from the 'cpExtractPtcTask'
initialExpIdMask = np.ravel(np.array(dataset.expIdMask[ampName]))

Expand All @@ -843,6 +844,11 @@ def errFunc(p, x, y):
self.fillBadAmp(dataset, ptcFitType, ampName)
continue

# Save the point where the variance starts decreasing as the
# PTC turnoff point
ptcTurnoff = meanVecOriginal[goodPoints][-1]
dataset.ptcTurnoff[ampName] = ptcTurnoff

mask = goodPoints

if ptcFitType == 'EXPAPPROXIMATION':
Expand Down Expand Up @@ -987,6 +993,7 @@ def fillBadAmp(self, dataset, ptcFitType, ampName):
dataset.ptcFitParsError[ampName] = (np.repeat(np.nan, self.config.polynomialFitDegree + 1) if
ptcFitType in ["POLYNOMIAL", ] else np.repeat(np.nan, 3))
dataset.ptcFitChiSq[ampName] = np.nan
dataset.ptcTurnoff[ampName] = np.nan
dataset.finalVars[ampName] = np.repeat(np.nan, len(dataset.rawExpTimes[ampName]))
dataset.finalModelVars[ampName] = np.repeat(np.nan, len(dataset.rawExpTimes[ampName]))
dataset.finalMeans[ampName] = np.repeat(np.nan, len(dataset.rawExpTimes[ampName]))
Expand Down

0 comments on commit e0f8453

Please sign in to comment.