-
Notifications
You must be signed in to change notification settings - Fork 14
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
draft: linear -> spline interp for waveform data #162
base: dev
Are you sure you want to change the base?
draft: linear -> spline interp for waveform data #162
Conversation
Add spline interpolation
@deepchatterjeeligo can you comment on the tolerance increases for the tests |
@@ -225,16 +225,16 @@ def test_phenom_d( | |||
hc_torch = hc_torch[torch_mask] | |||
|
|||
assert np.allclose( | |||
1e21 * hp_lal_data.real, 1e21 * hp_torch.real.numpy(), atol=2e-4 | |||
1e21 * hp_lal_data.real, 1e21 * hp_torch.real.numpy(), atol=3e-4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not make the tests pass without bumping the threshold a bit, which is strange given that spline interpolation should work better than linear. Any thought whether tweaking the kx, sx values can help? CC @wbenoit26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I might steer clear of using the spline interpolation for this application for now. There are significant deviations from scipy's interpolation if you interpolate too close to the edges of your input range. This is workable for something like the Q-transform, where we can crop out those effects, but that's not something that you can do here. I'd be curious to see if the match is better for values well within the range, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'll leave this marked as draft until the sanity is met.
lalsimulation uses spline interpolation for the phenom data. We have been using linear interpolation due to lacking implementation which we have now.