Skip to content

Commit

Permalink
finish segy test
Browse files Browse the repository at this point in the history
  • Loading branch information
d-chambers committed Dec 19, 2024
1 parent fbd6f6b commit 2c253c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dascore/io/segy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def twos_comp(bytes_):

def _get_segy_version(fp):
"""
Return True if file pointer contains segy formatted data.
Determine if file handle contains segy data.
Returns (segy, version) if so else False.
Based on ObsPy's implementation writen by Lion Krischer.
https://github.com/obspy/obspy/blob/master/obspy/io/segy/core.py
Expand Down
6 changes: 4 additions & 2 deletions tests/test_io/test_segy/test_segy.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def test_can_get_format(self, channel_patch_path):
def test_channel_patch_round_trip(self, channel_patch_path, channel_patch):
"""The channel patch should round trip."""
patch1 = channel_patch
patch2 = dc.spool(channel_patch_path)[0]

patch2 = dc.spool(channel_patch_path)[0].transpose(*patch1.dims)
# We really don't have a way to transport attributes yet, so we
# just check that data and coords are equal.
assert np.allclose(patch1.data, patch2.data)
assert patch1.coords == patch2.coords

0 comments on commit 2c253c6

Please sign in to comment.