-
Notifications
You must be signed in to change notification settings - Fork 529
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
SAC: Fix sampling rate floating point accuracy edge cases #3446
Conversation
otherwise sampling rate can suffer from floating point accuracy issues due to the single precision used in SAC to store sample spacing in the trace header
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.
Looks good, thank you! All these changes just to round a float 😄
🤣 It's like always, making the change would be a one-liner and about one minute of work, but thinking it through, documenting it properly, letting people know when it happens by showing a warning and properly testing both the actual change and the warning as well is 99% of the work and makes it a long task. That's how you see all these software projects from publications that are unusable to other people but fast to get a citation 😜 I do believe it's one of our strong points though, to be robust, reliable and transparent. Even if it slows us down these days (well more people dedicating time would help too 🤣). |
Thank you! |
What does this PR do?
Fixes reading some SAC files that suffer from floating point accuracy issues with their sampling interval stored in single precision.
Makes it opt-out, so the rounding can be deactivated and also it will show a warning if the rounding actually changed things during reading SAC.
Why was it initiated? Any relevant Issues?
fixes #3408
PR Checklist
master
for new features,maintenance_...
for bug fixesno_ci
label can be added to skip CI buildsJust add the
build_docs
tag to this PR.Docs will be served at docs.obspy.org/pr/{branch_name} (do not use master branch).
Please post a link to the relevant piece of documentation.
clients.fdsn
) should be tested for the PR,just add the
test_network
tag to this PR.CHANGELOG.txt
.CONTRIBUTORS.txt
.from all the CI builds look correct. Add the "upload_plots" tag so that plotting
outputs are attached as artifacts.
CODEOWNERS
with your github handleready for review
label when you are ready for the PR to be reviewed.