Skip to content
Snippets Groups Projects
Commit 3ebdff80 authored by Sylvia Biscoveanu's avatar Sylvia Biscoveanu
Browse files

Update unit test

parent 20e70fe7
No related branches found
No related tags found
1 merge request!1205BUGFIX: Fix whitening procedure
......@@ -562,7 +562,7 @@ class TestInterferometerWhitenedStrain(unittest.TestCase):
def setUp(self):
self.ifo = bilby.gw.detector.get_empty_interferometer('H1')
self.ifo.set_strain_data_from_power_spectral_density(
sampling_frequency=4096, duration=4)
sampling_frequency=4096, duration=64)
def tearDown(self):
del self.ifo
......@@ -570,8 +570,10 @@ class TestInterferometerWhitenedStrain(unittest.TestCase):
def test_whitened_strain(self):
mask = self.ifo.frequency_mask
white = self.ifo.whitened_frequency_domain_strain[mask]
std = np.std(white)
self.assertAlmostEqual(std, 1, places=2)
std_real = np.std(white.real)
std_imag = np.std(white.imag)
self.assertAlmostEqual(std_real, 1, places=2)
self.assertAlmostEqual(std_imag, 1, places=2)
if __name__ == "__main__":
......
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