Skip to content

Commit

Permalink
fix(delay): subtract sample mean instead of weighted mean
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgray committed Jun 15, 2024
1 parent e389b2b commit 59227a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions draco/analysis/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 59227a7

Please sign in to comment.