Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

header scan fails incorrect for little endian segy #258

Closed
anthonytorlucci opened this issue Aug 9, 2023 · 3 comments · Fixed by #281
Closed

header scan fails incorrect for little endian segy #258

anthonytorlucci opened this issue Aug 9, 2023 · 3 comments · Fixed by #281
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@anthonytorlucci
Copy link

In segyio, the buf is ALWAYS big endian regardless of the segy bytorder. Thus, def header_scan_worker() will result in incorrect header values for the snippet below from src/mdio/segy/_workers.py:

formats = [type_.numpy_dtype.newbyteorder(endian) for type_ in byte_types]

An issue was raised with segyio issues #559. Confirmed in discussion on Slack.

Example of behavior can be found at anthonytorlucci/segyio_header_buf.

@tasansal
Copy link
Collaborator

Thanks for raising the issue. We will take a look before the next release.

@tasansal tasansal added bug Something isn't working dependencies Pull requests that update a dependency file labels Aug 15, 2023
@anthonytorlucci
Copy link
Author

I believe the fix is very simple (line 86 in /src/mdio/segy/_workers.py)

formats = [type_.numpy_dtype.newbyteorder('>') for type_ in byte_types]

since the byte order in buf is always BIG.

I forked the project, but unable to run nox without errors so I haven't submitted a pull request.

@tasansal
Copy link
Collaborator

@anthonytorlucci I made the fix and its on the main branch. Can you test it either:

  1. test pypi: https://test.pypi.org/project/multidimio/
  2. clone main and install locally

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
2 participants