Commit 2e577a5c authored by Colm Talbot's avatar Colm Talbot
Browse files

Merge branch 'interferometer_list_setting' into 'master'

Made `interferometers` a property so that lists of interferometer are...

See merge request !389
parents 89a95f1e c4f40780
Pipeline #53942 failed with stages
in 9 minutes and 31 seconds
......@@ -391,6 +391,14 @@ class GravitationalWaveTransient(likelihood.Likelihood):
self.time_prior_array =\
self.priors['geocent_time'].prob(self._times) * delta_tc
@property
def interferometers(self):
return self._interferometers
@interferometers.setter
def interferometers(self, interferometers):
self._interferometers = InterferometerList(interferometers)
class BasicGravitationalWaveTransient(likelihood.Likelihood):
......
......@@ -134,6 +134,19 @@ class TestGWTransient(unittest.TestCase):
'priors={})'.format(self.interferometers, self.waveform_generator, False, False, False, self.prior)
self.assertEqual(expected, repr(self.likelihood))
def test_interferometers_setting_list(self):
ifos = [bilby.gw.detector.get_empty_interferometer(name=name) for name in ['H1', 'L1']]
self.likelihood.interferometers = ifos
self.assertListEqual(bilby.gw.detector.InterferometerList(ifos), self.likelihood.interferometers)
self.assertTrue(type(self.likelihood.interferometers) == bilby.gw.detector.InterferometerList)
def test_interferometers_setting_interferometer_list(self):
ifos = bilby.gw.detector.InterferometerList([bilby.gw.detector.get_empty_interferometer(name=name)
for name in ['H1', 'L1']])
self.likelihood.interferometers = ifos
self.assertListEqual(bilby.gw.detector.InterferometerList(ifos), self.likelihood.interferometers)
self.assertTrue(type(self.likelihood.interferometers) == bilby.gw.detector.InterferometerList)
class TestTimeMarginalization(unittest.TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment