Skip to content
Snippets Groups Projects
Commit 09667f8b authored by Colm Talbot's avatar Colm Talbot
Browse files

apply frequency mask to noise realisation test

parent 988f415c
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ class TestNoiseRealisation(unittest.TestCase):
def test_averaged_noise(self):
time_duration = 1.
sampling_frequency = 4096.
factor = np.sqrt(2./time_duration)
factor = np.sqrt(2 / time_duration)
n_avg = 1000
psd_avg = 0
interferometer = tupak.gw.detector.get_empty_interferometer('H1')
......@@ -16,11 +16,12 @@ class TestNoiseRealisation(unittest.TestCase):
interferometer.set_data(sampling_frequency, time_duration, from_power_spectral_density=True)
psd_avg += abs(interferometer.data)**2
psd_avg = psd_avg/n_avg
asd_avg = np.sqrt(abs(psd_avg))
psd_avg = psd_avg / n_avg
asd_avg = np.sqrt(abs(psd_avg)) * interferometer.frequency_mask
a = interferometer.amplitude_spectral_density_array/factor
a = np.nan_to_num(interferometer.amplitude_spectral_density_array / factor * interferometer.frequency_mask)
b = asd_avg
print(a, b)
self.assertTrue(np.allclose(a, b, rtol=1e-1))
def test_noise_normalisation(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment