diff --git a/AUTHORS.md b/AUTHORS.md index 71baaa6e947fae44cd327ab1a2506cc5afa9004c..b4e9f6bf004f14a4642ba990baee6a17711c2c13 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -69,6 +69,7 @@ Sharan Banagiri Shichao Wu Simon Stevenson Soichiro Morisaki +Stephen R Green Sumeet Kulkarni Sylvia Biscoveanu Tathagata Ghosh diff --git a/bilby/gw/detector/detectors/GEO600.interferometer b/bilby/gw/detector/detectors/GEO600.interferometer index bf84d748c8dd88e121fbcb3a5c1aa1c0ddad83bd..addde6d1cd21593eb7a0d91c53bcba93a393171b 100644 --- a/bilby/gw/detector/detectors/GEO600.interferometer +++ b/bilby/gw/detector/detectors/GEO600.interferometer @@ -9,5 +9,5 @@ length = 0.6 latitude = 52 + 14. / 60 + 42.528 / 3600 longitude = 9 + 48. / 60 + 25.894 / 3600 elevation = 114.425 -xarm_azimuth = 115.9431 -yarm_azimuth = 21.6117 +xarm_azimuth = 21.6117 +yarm_azimuth = 115.9431 diff --git a/bilby/gw/detector/detectors/K1.interferometer b/bilby/gw/detector/detectors/K1.interferometer index 8585857ac1eac558056fb78582beebe9f610afe7..9120d24b71ab54ebd4a426b7ab95cc9050ca51e1 100644 --- a/bilby/gw/detector/detectors/K1.interferometer +++ b/bilby/gw/detector/detectors/K1.interferometer @@ -15,3 +15,5 @@ longitude = 137 + 18 / 60 + 21.44171 / 3600 elevation = 414.181 xarm_azimuth = 90 - 60.39623489157727 yarm_azimuth = 90 + 29.60357629670688 +xarm_tilt = 0.0031414 +yarm_tilt = -0.0036270 diff --git a/bilby/gw/detector/detectors/L1.interferometer b/bilby/gw/detector/detectors/L1.interferometer index 26f34e03b1f73d79f2ab0a6c9e6f0f68b88f2f87..840473e94dad673be4418ff28b0cf238b97438ad 100644 --- a/bilby/gw/detector/detectors/L1.interferometer +++ b/bilby/gw/detector/detectors/L1.interferometer @@ -11,3 +11,5 @@ longitude = -(90 + 46. / 60 + 27.2654 / 3600) elevation = -6.574 xarm_azimuth = 197.7165 yarm_azimuth = 287.7165 +xarm_tilt = -3.121e-4 +yarm_tilt = -6.107e-4 diff --git a/test/gw/detector/interferometer_test.py b/test/gw/detector/interferometer_test.py index b01b57e17fe2a1562546c24e8f0fa28e84aebe47..3c879d22a766955bb5f37a764f075fd8f88a7281 100644 --- a/test/gw/detector/interferometer_test.py +++ b/test/gw/detector/interferometer_test.py @@ -1,5 +1,8 @@ import sys import unittest + +import lal +import lalsimulation import pytest from packaging import version from shutil import rmtree @@ -552,5 +555,46 @@ class TestInterferometerEquals(unittest.TestCase): self.assertNotEqual(self.ifo_1, self.ifo_2) +class TestInterferometerAntennaPatternAgainstLAL(unittest.TestCase): + def setUp(self): + self.name = "name" + self.ifo_names = ['H1', 'L1', 'V1', 'K1', 'GEO600', 'ET'] + self.lal_prefixes = {'H1': 'H1', 'L1': 'L1', 'V1': 'V1', 'K1': 'K1', 'GEO600': 'G1', 'ET': 'E1'} + self.polarizations = ['plus', 'cross', 'breathing', 'longitudinal', 'x', 'y'] + self.ifos = bilby.gw.detector.InterferometerList(self.ifo_names) + self.gpstime = 1305303144 + self.trial = 100 + + def tearDown(self): + del self.name + del self.ifo_names + del self.lal_prefixes + del self.polarizations + del self.ifos + del self.gpstime + del self.trial + + def test_antenna_pattern_vs_lal(self): + gmst = lal.GreenwichMeanSiderealTime(self.gpstime) + f_bilby = np.zeros((self.trial, 6)) + f_lal = np.zeros((self.trial, 6)) + + for n, ifo_name in enumerate(self.ifo_names): + response = lalsimulation.DetectorPrefixToLALDetector(self.lal_prefixes[ifo_name]).response + ifo = self.ifos[n] + for i in range(self.trial): + ra = 2. * np.pi * np.random.uniform() + dec = np.pi * np.random.uniform() - np.pi / 2. + psi = np.pi * np.random.uniform() + f_lal[i] = lal.ComputeDetAMResponseExtraModes(response, ra, dec, psi, gmst) + for m, pol in enumerate(self.polarizations): + f_bilby[i, m] = ifo.antenna_response(ra, dec, self.gpstime, psi, pol) + + std = np.std(f_bilby - f_lal, axis=0) + for m, pol in enumerate(self.polarizations): + with self.subTest(':'.join((ifo_name, pol))): + self.assertAlmostEqual(std[m], 0.0, places=7) + + if __name__ == "__main__": unittest.main()