Skip to content

Commit a4d8b9d

Browse files
committed
Add segy sub-version for Silixa Carina
1 parent a89ff7b commit a4d8b9d

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

dascore/io/segy/core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ class SegyV0_0(SegyV1_0): # noqa
9797
version = "0.0"
9898

9999

100+
class SegyV0_1(SegyV1_0): # noqa
101+
"""
102+
An IO class supporting version 0.100 of the SEGY format.
103+
104+
This odd version is output by some Silixa files.
105+
"""
106+
107+
version = "0.100"
108+
109+
100110
class SegyV2_0(SegyV1_0): # noqa
101111
"""An IO class supporting version 2.0 of the SEGY format."""
102112

dascore/io/segy/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _get_segy_version(fp):
3535
Based on ObsPy's implementation writen by Lion Krischer.
3636
https://github.com/obspy/obspy/blob/master/obspy/io/segy/core.py
3737
"""
38-
# # Read 400byte header into byte string.
38+
# Read 400byte header into byte string.
3939
fp.seek(3200)
4040
header = fp.read(400)
4141
data_trace_count = twos_comp(header[12:14])
@@ -60,11 +60,12 @@ def _get_segy_version(fp):
6060
# Sanity checks for other values.
6161
data_trace_count >= 0,
6262
auxiliary_trace_count >= 0,
63-
format_number_minor in {0, 1, 2, 3},
63+
format_number_minor in {0, 1, 2, 3, 100},
6464
fixed_len_flag in {0, 1},
6565
)
6666
if all(checks):
67-
return "segy", f"{format_number_major}.{format_number_minor}"
67+
version = f"{format_number_major}.{format_number_minor}"
68+
return "segy", version
6869
else:
6970
return False
7071

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ TERRA15__V4 = "dascore.io.terra15.core:Terra15FormatterV4"
120120
TERRA15__V5 = "dascore.io.terra15.core:Terra15FormatterV5"
121121
TERRA15__V6 = "dascore.io.terra15.core:Terra15FormatterV6"
122122
SILIXA_H5__V1 = "dascore.io.silixah5:SilixaH5V1"
123+
SEGY__V0_0 = "dascore.io.segy.core:SegyV0_0"
124+
SEGY__V0_100 = "dascore.io.segy.core:SegyV0_100"
123125
SEGY__V1_0 = "dascore.io.segy.core:SegyV1_0"
124126
SEGY__V2_0 = "dascore.io.segy.core:SegyV2_0"
125127
SEGY__V2_1 = "dascore.io.segy.core:SegyV2_1"

0 commit comments

Comments
 (0)