-
Notifications
You must be signed in to change notification settings - Fork 86
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
Template write / read merges traces in rare case where traces from same channel align exactly #497
Milestone
Comments
Nice spot! That's an ugly bug, thanks for finding it. I think we should probably try to cope with it in here if we can, although I'm not sure how at the moment.... Sorry for the bug! |
I see that the record numbers in the mseed-file stillindicate that it was originally two traces:
But I can't see that this information is read into the stream object: st.select(station='ARA1')[0].stats.mseed
AttribDict({'dataquality': 'D', 'number_of_records': 66, 'encoding': 'FLOAT64',
'byteorder': '>', 'record_length': 512, 'blkt1001': AttribDict({'timing_quality': 0}),
'calibration_type': False, 'filesize': 1563648}) |
Open
6 tasks
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Consider a template for a 1-component sensor with only a vertical channel, with P- and S-pick on the same trace. If the traces happen to line up exactly, that is, the first sample of the S-trace follows the last sample of the P-trace, then the obspy / mseed library merges the waveforms for the P- and S-part into one trace. The result is a template where some traces suddenly have double the length, and once there is a mix of trace lengths, then of course EQcorrscan will report an error.
To Reproduce
see attached template object - trace NS.ARA1.00.BHZ is merged into one trace when reading, even though the template had two traces for NS.ARA1.00.BHZ before writing.
Template_sample.gz (.tgz file renamed to .gz due to file type restrictions on Github)
Expected behavior
The trace should be properly split into the two parts for P and S.
Desktop (please complete the following information):
Additional context
This problem is not directly caused by EQcorrscan, but rather by the mseed-reading routines. I'm trying to look for some lower-level options that stop how the data are merged into one trace in the miniseed routines, but I don't know the codes so well so this may take some time. I'm not sure yet whether this is an issue of reading or writing the miniseed file. If the mseed library doesn't allow the trace to be split in this case, then we may have to think of a workaround or some extra checks.
Even though I'm continuing to investigate, if you have any ideas, please let me know!
The text was updated successfully, but these errors were encountered: