Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 7dq4 dynamics closer to the LAL version #2

Merged
merged 1 commit into from
Nov 19, 2019
Merged
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
22 changes: 16 additions & 6 deletions gwsurrogate/new/precessing_surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,28 @@ def _get_t_from_omega(self, omega_ref, q, chiA0, chiB0, init_orbphase,
raise Exception("Got omega_ref = %0.4f < %0.4f = omega_0, "
"too small!"%(omega_ref, omega0))

# In this function we don't use the 3 half-node indices at the
# start. This is mainly to agree with the LAL implementation, where
# this was done, and should not affect anything meaningful.
full_node_indices = range(len(self.t))
full_node_indices.remove(1)
full_node_indices.remove(3)
full_node_indices.remove(5)

# i0=0 is a lower bound, find the first index where omega > omega_ref
imax=1
omega_max = self.get_omega(imax, q, y0)
imax = 1
omega_min = omega0
omega_max = self.get_omega(full_node_indices[imax], q, y0)
while omega_max <= omega_ref:
imax += 1
omega_min = omega_max
omega_max = self.get_omega(imax, q, y0)
omega_max = self.get_omega(full_node_indices[imax], q, y0)

# Interpolate
t_ref = (self.t[imax-1] * (omega_max - omega_ref)
+ self.t[imax] * (omega_ref - omega_min))/(omega_max - omega_min)
# Do a linear interpolation between omega_min and omega_max
t_min = self.t[full_node_indices[imax-1]];
t_max = self.t[full_node_indices[imax]];
t_ref = (t_min * (omega_max - omega_ref)
+ t_max * (omega_ref - omega_min)) / (omega_max - omega_min);

if t_ref < self.t[0] or t_ref > self.t[-1]:
raise Exception("Somehow, t_ref ended up being outside of "
Expand Down