changed plottable default, new resampled method
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Sequence
|
||||
from typing import Self, Sequence
|
||||
|
||||
import numpy as np
|
||||
import scipy.signal as ss
|
||||
@@ -90,7 +90,7 @@ class NoiseMeasurement:
|
||||
wavelength: float | None = None,
|
||||
power: float | None = None,
|
||||
left: int | None = None,
|
||||
discard_nyquist: bool = False,
|
||||
discard_nyquist: bool = True,
|
||||
) -> tuple[np.ndarray, np.ndarray]:
|
||||
"""
|
||||
Transforms the PSD in a way that makes it easy to plot
|
||||
@@ -186,6 +186,9 @@ class NoiseMeasurement:
|
||||
interp = np.interp(f, self.freq, self.psd, left=self.psd[0], right=self.psd[-1])
|
||||
return f, interp
|
||||
|
||||
def resampled(self, nf: int, dt: float | None = None, log_mode: bool = False) -> Self:
|
||||
return self.__class__(*self.sample_spectrum(nf, dt, log_mode))
|
||||
|
||||
def time_series(
|
||||
self,
|
||||
nf: int,
|
||||
|
||||
Reference in New Issue
Block a user