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

Fix robust_fit for large timestamps by subtracting offset #73

Merged
merged 2 commits into from
Dec 30, 2020

Conversation

cboulay
Copy link
Contributor

@cboulay cboulay commented Dec 29, 2020

Fixes issue reported here and by user in Slack.

Briefly, very large timestamp values (especially on systems using seconds since 1970) lead to instabilities due to insufficient numerical precision. Here we subtract a constant from the timestamps before calculating the fit between timestamps and offsets. The offset is added back before returning.

There was also a little extra to be done to keep winsor_threshold functioning properly.

Sister PR in Matlab: xdf-modules/xdf-Matlab#9

pyxdf/pyxdf.py Outdated Show resolved Hide resolved
@cboulay
Copy link
Contributor Author

cboulay commented Dec 30, 2020

Before review of #74 , I'd like to this to be reviewed and merged. Are there any outstanding concerns?

@tstenner
Copy link
Contributor

Are there any outstanding concerns?

Yes, it hasn't been merged yet :-)

@cboulay cboulay merged commit 5384490 into master Dec 30, 2020
@cbrnr cbrnr deleted the robust_fit_offset branch December 30, 2020 19:16
@cbrnr
Copy link
Contributor

cbrnr commented Dec 30, 2020

Thanks @cboulay!

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