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

wrong end time when querying long traces #2

Open
niyiyu opened this issue Sep 22, 2022 · 1 comment
Open

wrong end time when querying long traces #2

niyiyu opened this issue Sep 22, 2022 · 1 comment

Comments

@niyiyu
Copy link
Owner

niyiyu commented Sep 22, 2022

This is a known issue from obspy. When obspy reads an miniSEED stream, it reads only the start time, sampling rate and the number of samples. Then obspy will calculate the end time of the trace on-the-fly. Usually, the sampling rate is not accurate enough to have a perfectly accurate end time, meaning that the waveform will shrink or expand. This is negligible for short trace, e.g., 30 minutes for 1 data points for traces@100Hz. However, when you query a day-long trace, the misfit could be up to ~50 samples, which is about 0.5 seconds. The solution is querying a shorter stream when use obspy.read(), which is not implement by pnwstore yet.

@niyiyu
Copy link
Owner Author

niyiyu commented Sep 25, 2022

It turns out that obspy bypassed this bug through passing a start/end time to obspy.read. Thus it is recommended to read a shorter trace at a time by passing a start/end time, instead of a day-long file. This also save bandwidth of data streaming from pnwstore1. If you are indeed need to read day-long mSEED file, be aware of such feature of obspy.

See commit d9b8468.

@niyiyu niyiyu closed this as completed Sep 25, 2022
@niyiyu niyiyu reopened this Sep 25, 2022
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