diff --git a/lumicks/pylake/force_calibration/power_spectrum.py b/lumicks/pylake/force_calibration/power_spectrum.py index 35bb5fd7e..e6628fd7e 100644 --- a/lumicks/pylake/force_calibration/power_spectrum.py +++ b/lumicks/pylake/force_calibration/power_spectrum.py @@ -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