Skip to content

Commit

Permalink
powerspectrum: add option to downsample raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Jan 14, 2025
1 parent 62406ba commit 6ed017b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lumicks/pylake/force_calibration/power_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@ def with_spectrum(self, power, num_points_per_block=1, variance=None) -> "PowerS
variance=variance,
)

def compress(self):
"""Returns a compressed power spectrum by downsampling the internal data"""
return PowerSpectrum(
self.frequency,
self.power,
self.sample_rate,
self.total_duration,
self.unit,
num_points_per_block=self.num_points_per_block,
total_samples_used=self.total_samples_used,
variance=self._variance,
)

def plot(self, *, show_excluded=False, **kwargs):
"""Plot power spectrum
Expand Down

0 comments on commit 6ed017b

Please sign in to comment.