diff --git a/draco/analysis/delay.py b/draco/analysis/delay.py index 7a9b8b7a7..5ddd54c30 100644 --- a/draco/analysis/delay.py +++ b/draco/analysis/delay.py @@ -610,10 +610,9 @@ def _cut_data( # Remove the mean from the data before estimating the spectrum if self.remove_mean: - dmean = (data * weight).mean(axis=0) * tools.invert_no_zero( - weight.mean(axis=0) - ) - data = data - dmean[np.newaxis, :] + # Do not apply this in place to make sure we don't modify + # the input data + data = data - np.mean(data, axis=0)[np.newaxis] # If there are no non-zero data entries skip if (data == 0.0).all():