From 59227a719966267e0a110aa5ed693f5b7e5d8e11 Mon Sep 17 00:00:00 2001 From: Liam Gray Date: Sat, 15 Jun 2024 10:11:36 -0700 Subject: [PATCH] fix(delay): subtract sample mean instead of weighted mean --- draco/analysis/delay.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/draco/analysis/delay.py b/draco/analysis/delay.py index 7a9b8b7a..5ddd54c3 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():