Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions bilby/gw/detector/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def __init__(
if isinstance(maximum_frequency, float) or isinstance(maximum_frequency, int):
maximum_frequency = [maximum_frequency] * 3

brng = 90 - xarm_azimuth

for ii in range(3):
self.append(
Interferometer(
Expand All @@ -376,29 +378,23 @@ def __init__(
)
)

xarm_azimuth += 240
yarm_azimuth += 240

latitude += (
np.arctan(
length
* np.sin(xarm_azimuth * np.pi / 180)
* 1e3
/ utils.radius_of_earth
)
* 180
/ np.pi
phi1 = np.radians(latitude)
phi2 = np.arcsin(
np.sin(phi1) * np.cos(length * 1e3 / utils.radius_of_earth) +
np.cos(phi1) * np.sin(length * 1e3 / utils.radius_of_earth) * np.cos(np.radians(brng))
)
longitude += (
np.arctan(
length
* np.cos(xarm_azimuth * np.pi / 180)
* 1e3
/ utils.radius_of_earth
)
* 180
/ np.pi
latitude = np.degrees(phi2)

lam1 = np.radians(longitude)
lam2 = lam1 + np.arctan2(
np.sin(np.radians(brng)) * np.sin(length * 1e3 / utils.radius_of_earth) * np.cos(phi1),
np.cos(length * 1e3 / utils.radius_of_earth) - np.sin(phi1) * np.sin(phi2)
)
longitude = np.degrees(lam2)

brng += 240
xarm_azimuth += 240
yarm_azimuth += 240


def get_empty_interferometer(name):
Expand Down
2 changes: 1 addition & 1 deletion test/gw/detector/networks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def c(a):
for pair in list(combinations(self.triangular_ifo, 2)):
delta_lat = np.radians(pair[1].latitude - pair[0].latitude)
delta_long = np.radians(pair[1].longitude - pair[0].longitude)
pair_a = a(delta_lat, delta_long, pair[0].latitude, pair[1].latitude)
pair_a = a(delta_lat, delta_long, np.radians(pair[0].latitude), np.radians(pair[1].latitude))
pair_c = c(pair_a)
distance = bilby.core.utils.radius_of_earth * pair_c
self.assertAlmostEqual(distance / 1000, pair[0].length, delta=1)
Expand Down
Loading