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

draft: linear -> spline interp for waveform data #162

Draft
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

deepchatterjeeligo
Copy link
Contributor

lalsimulation uses spline interpolation for the phenom data. We have been using linear interpolation due to lacking implementation which we have now.

@EthanMarx
Copy link
Collaborator

EthanMarx commented Nov 5, 2024

@deepchatterjeeligo can you comment on the tolerance increases for the tests
? If we're supposedly matching lalinference better shouldn't those go down?

@@ -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
Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@deepchatterjeeligo deepchatterjeeligo changed the title linear -> spline interp for waveform data draft: linear -> spline interp for waveform data Nov 6, 2024
@deepchatterjeeligo deepchatterjeeligo marked this pull request as draft November 6, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants