You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following change could make these files get recognized as well (the reader just omits everything above WID1 line). Not sure if it's worth it though as this might slow down file format detection to some extent as it makes the format check look through the whole file.
diff --git a/obspy/io/gse2/core.py b/obspy/io/gse2/core.py
index 0ec9ff962..437af3c83 100644
--- a/obspy/io/gse2/core.py+++ b/obspy/io/gse2/core.py@@ -118,12 +118,14 @@ def _is_gse1(filename):
"""
# Open file.
with open(filename, 'rb') as f:
- try:- data = f.readline()- except Exception:- return False- if data.startswith(b'WID1') or data.startswith(b'XW01'):- return True+ data = True+ while data:+ try:+ data = f.readline()+ except Exception:+ return False+ if data.startswith(b'WID1') or data.startswith(b'XW01'):+ return True
return False
Some GSE1 files seem to have additional lines before
WID1
header line. These are currently not detected as GSE1 by the automatic file format check.Example:
The following change could make these files get recognized as well (the reader just omits everything above
WID1
line). Not sure if it's worth it though as this might slow down file format detection to some extent as it makes the format check look through the whole file.CC @jwassermann
The text was updated successfully, but these errors were encountered: