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 sync_timestamps more performant #53

Open
k1o0 opened this issue Dec 17, 2024 · 0 comments
Open

Make sync_timestamps more performant #53

k1o0 opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@k1o0
Copy link
Contributor

k1o0 commented Dec 17, 2024

The following lines cause memory to increase and performance to decrease as the fixed offset between timestamps increases.

tmin = np.min([np.min(tsa), np.min(tsb)])
tmax = np.max([np.max(tsa), np.max(tsb)])
# brute force correlation to get an estimate of the delta_t between series
x = np.zeros(int(np.ceil(tmax - tmin) / tbin))
y = np.zeros_like(x)

This could be resolved by first subtracting the offset between the first timestamp of both arrays, then adding it back as a constant in the interpolation function

@k1o0 k1o0 self-assigned this Dec 17, 2024
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

No branches or pull requests

1 participant