WIP: Fix bug where perfectly aligning traces are merged into one trace by MSeed read routine #498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
First attempt at fixing #497. This checks that all template traces have the same length. If it finds any traces that have double (or another multiple) of the "normal" template length, then it splits these traces into traces of the exact same length with the newly corrected start and endtimes.
I will add testing / changes-log once I / we feel that this is the right way to avoid the bug.
Why was it initiated? Any relevant Issues?
The fix here keeps all the checks within EQcorrscan, while in theory I was hoping to find an option that avoids the behavior that leads to this bug in the mseed-routines. But I don't think that such an option exists there for exact matches; the only option I do know is that one case change a hard-coded option in the miniseed-library to reduce the tolerance until which traces are merged. But that only concerns the matching of time samples; not block numbers as far as I know.
As we don't (yet) save template length as a template / tribe metadata, the following edge cases would not be solved by this PR:
PR Checklist
develop
base branch selected?CHANGES.md
.[ ] First time contributors have added your name toCONTRIBUTORS.md
.