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

fix conversion tests

parent 48dcbbc2
No related branches found
No related tags found
1 merge request!85fix conversion tests
Pipeline #
......@@ -88,8 +88,8 @@ class TestConvertToLALBBHParams(unittest.TestCase):
self.search_keys.append('cos_tilt_1')
self.parameters['cos_tilt_1'] = 1
self.parameters, _ = tupak.gw.conversion.convert_to_lal_binary_black_hole_parameters(self.parameters, self.search_keys, remove=True)
self.assertDictEqual(self.parameters, dict(tilt_1 = 42))
self.assertDictEqual(self.parameters, dict(tilt_1=42, cos_tilt_1=1))
if __name__=='__main__':
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
......@@ -113,10 +113,8 @@ def convert_to_lal_binary_black_hole_parameters(parameters, search_keys, remove=
for angle in ['tilt_1', 'tilt_2', 'iota']:
cos_angle = str('cos_' + angle)
if cos_angle in converted_parameters.keys() and cos_angle not in search_keys:
if cos_angle in converted_parameters.keys():
converted_parameters[angle] = np.arccos(converted_parameters[cos_angle])
if remove:
added_keys.append(cos_angle)
added_keys.append(angle)
added_keys = [key for key in added_keys if key not in search_keys]
......
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