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.
Before that commit all SEGY file were supposed to be BIG endian and the host machine is LITTLE endian.
It weren"t working with LITTLE endian SEGY on LITTLE endian machine.
Now the endianness of machine is cheked using Base.ENDIAN_BOM value and SEGY endian is checked using 3225-3226 file binare header value (Data Sample Format code) wich is supposed to be in range 1-16 (from the SEGY Revision).
The most importnat here is the function
bswap_needed(s::IO)
that checks whether swap bytes is needed or not.It is important that
s::IO
was opened from the beginning of the file.That is thrue when reading
file_header
but this is not true when reading traces or trace_headers.That is why
swap_bytes
argument for these functions doesn"t have default value.Also
bigendian::Bool
argument for some functions was renamed toswap_bytes::Bool
.I locally checked the correctness of reading and scanning IEEE little/big endian SEGY and IBMFLOAT32 big endian SEGY on my LITTLE endian machine and it is working correctly.