Skip to content

Commit

Permalink
Remove unnecessary padding of piecewise linear ("spline") model.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Nov 29, 2023
1 parent ee0cc65 commit 195dd0d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/lsst/cp/pipe/deferredCharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ def findTraps(self, inputMeasurements, calib, detector):
# Create spline model for the trap, using the residual
# between data and model as a function of the last image
# column mean (new_signal) scaled by (1 - A_L).
# Note that this ``spline`` model is actually a piecewise
# linear interpolation and not a true spline.
new_signal = np.asarray((1 - calib.driftScale[ampName])*new_signal, dtype=np.float64)
x = new_signal
y = np.maximum(0, res)
Expand All @@ -602,10 +604,6 @@ def findTraps(self, inputMeasurements, calib, detector):
y = np.pad(y, (10, 0), 'linear_ramp', end_values=(0, 0))
x = np.pad(x, (10, 0), 'linear_ramp', end_values=(0, 0))

# Pad right with constant
y = np.pad(y, (1, 1), 'constant', constant_values=(0, y[-1]))
x = np.pad(x, (1, 1), 'constant', constant_values=(-1, 200000.))

trap = SerialTrap(20000.0, 0.4, 1, 'spline', np.concatenate((x, y)).tolist())
calib.serialTraps[ampName] = trap

Expand Down

0 comments on commit 195dd0d

Please sign in to comment.