BUG: fix triangular interferometer coordinates #1016
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I believe I have found two bugs in the implementation of the triangular-shaped interferometer.
The first issue concerns this test, where the angles passed to this function should be given in radians, as also stated in [1]. However, in the current implementation, the last two latitude values are passed in degrees.
When the angles are passed correctly, the test fails. For example, if the position of the first vertex is set to
(40.516°, 9.416°)withx_arm_azimuth = 70.5674°, the distances between the vertices are:ET-1↔️ ET-2: 9.06 km↔️ ET-3: 9.76 km↔️ ET-3: 7.70 km
ET-1
ET-2
I believe this test failure is due to an incorrect implementation of the functions updating latitude and longitude, which differ from those provided in [1]:
The only difference to keep in mind is the definition of the bearing angle: in bilby it is defined counterclockwise from east, whereas in [1] it is clockwise from north. This leads to the following conversion:
Using the above expressions, the coordinates are recovered correctly.
I also include a map illustrating this result: the blue dots represent the incorrect coordinates, while the red dots show the corrected ones.
I believe this also resolves this issue, since, when using the Virgo site coordinates as the starting point, it becomes possible to recover the positions of the other two vertices correctly, as defined in LAL.
I don’t think this bug has any practical effect on previously obtained parameter estimation results.
I’m opening this pull request to contribute to fixing this bug.
I am tagging a few people who might be interested in the matter @jacopo.tissino @sylvia.biscoveanu
Thanks a lot in advance.
Kind regards,
Filippo
[1] https://www.movable-type.co.uk/scripts/latlong.html