quick fixes

This commit is contained in:
2024-02-06 16:28:28 +01:00
parent c65eebb2dc
commit e13192259e
4 changed files with 13 additions and 6 deletions

View File

@@ -17,14 +17,14 @@ def test_normalisation():
def test_time_and_back():
"""
sampling a time series from a spectrum and transforming
it back should yield the same spectrum
it back yields the same spectrum
"""
rng = np.random.default_rng(57)
t = np.linspace(-10, 10, 512)
signal = np.exp(-((t / 2.568) ** 2)) + rng.random(len(t)) / 15
noise = sc.noise.NoiseMeasurement.from_time_series(signal, 1, "boxcar", detrend=False)
_, new_signal = noise.time_series(len(t))
_, new_signal = noise.time_series(len(noise.freq))
new_noise = sc.noise.NoiseMeasurement.from_time_series(new_signal, 1, "boxcar", detrend=False)
assert new_noise.psd == pytest.approx(noise.psd)