Catch divided by zero error - #8
Open
florentaden wants to merge 2 commits into
Open
Conversation
I used .get_waveforms for specific starttime and endtime, for any station and location available and HHZ,EHZ components. Some trace would contain a single point throwing a divided by zero error. I just added a if condition to catch the problem, only missing one or two stations max. I have observed another error related to the mseed package and ctypes that I haven't been able to catch: ```bash playback-1 | Exception ignored in: <function MSTraceList.__del__ at 0x7f5223340e50> playback-1 | Traceback (most recent call last): playback-1 | File "/usr/local/lib/python3.10/site-packages/mseedlib/mstracelist.py", line 480, in __del__ playback-1 | for segment in traceid.segments(): playback-1 | File "/usr/local/lib/python3.10/site-packages/mseedlib/mstracelist.py", line 317, in segments playback-1 | current_segment.contents.info.traceid_address = ct.addressof(self) playback-1 | File "/usr/local/lib/python3.10/site-packages/mseedlib/mstracelist.py", line 102, in info playback-1 | self._prvtptr = ct.cast(raw_buffer, ct.POINTER(TraceSegInfo)) playback-1 | ValueError: ctypes object structure too deep ```
|
kia Ora @pasansherath this shoudl be easy ot review ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some stations returned a single data point which triggers a divided by zero error in the
function _fix_mseed_timing.Adding a if condition controlling the length of
datasolve the problem and skipped the few problematic traces.Error can be reproduced running this: