Code Monkey home page Code Monkey logo

Comments (8)

rob-smallshire avatar rob-smallshire commented on July 26, 2024

Be aware that the example programs aren't ported to, or tested on, Windows, which is why you get two errors - one caused by the SeisWare file problem and another because the program expects to be running on a Linux or MacOS. The latter is trivial to fix – just don't use the os.EX_* constants. See #17

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

From the user:

I attached 2 files, one is in seisware segy and the other I exported from seisware as generic segy.

seisware_segy.zip

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

I took a look at your files.

First of all, they appear to be in little-endian format (though I might be wrong about this). The example code you were using is hard-wired to big-endian (the SEG Y standard) so you need to pass the correct endian parameter to the call to create_reader().

Second, the reason Segpy complains about unknown SEG Y Revision 29559 is because that is the revision recorded in your in your file.

According the to SEG Y standard, bytes 3501-3502 contain the revision number (note these byte offsets are using Fortran-style 1-based indexing).

screen shot 2017-08-02 at 12 33 24

In the file you sent me (different to the one above), the bytes at offset 3500-3501 (using 0-based indexing) contain 0x7465 in hexadecimal which is either 29797 in big-endian decimal or 25972 in little-endian decimal:

screen shot 2017-08-02 at 12 35 50

Neither of these are legitimate SEG Y revision numbers. As you can see from the standard, legitimate values are 0x0100 for SEG Y Revision 1 or 0x0000 for SEG Y revision 0. I can't make sense of the 0x7465 bytes by interpreting them as EBCDIC or ASCII either, so I'm not sure what Seisware is using this mandatory field for. A question for them, perhaps?

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

From the user:

I am not sure why they made the changes to the SEGY standard but it is what users of Seisware are stuck with.

By endian do you mean IBM vs IEEE format? Can you give me an example of how to add this to the create_reader() call?

Is the 3501 reference to the file or trace header position?

I know they also put one line of ascii to the bottom of the ebcdic header, again don't know why.

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

Endian refers to the byte order within multi-byte integers and whether the most-significant byte is first, or the least significant byte is first. https://en.wikipedia.org/wiki/Endianness The endianness of SEG-Y files is supposed to be big-endian (most significant first) – at least in SEG Y revisions 0 and 1. Endianness is a separate issue from the floating-point format which is IBM or IEEE.

You can modify the example to expect little-endian data, like this:

segy_reader = create_reader(in_file, endian='<')

but be aware that is probably still won't work because of the odd value in the SEG-Y revision number field of the binary header.

The 3501 is the byte offset in the file. As you can see in the attached cheat-sheet, this offset falls squarely in the middle of the binary file header: https://dl.dropboxusercontent.com/u/14965965/SEGY_revisions.pdf

I recommend you ask the Seisware folks to explain why their files are the way they are.

Segpy is engineered very much as a kit of parts, and although it tries to do the right thing by default, this doesn't work when vendors stray too far from the standard, as appears to have happened here. It will be possible to use some of Segpy's lower-level components to construct a reader which works with Seisware data, and this is something we could undertake do on a contract basis if you don't have the capabilities in-house to work with the open source code.

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

One potential solution to this is to allow the client to specify a custom binary file header format to the create_reader() call, in much the same way as we allow them to specify a custom trace header format. Essentially this would entail adding a binary_file_header_format argument to create_reader().

Another approach would be to just make a create_seisware_reader() function which utilises the lower-level toolkit functions.

Either way, it's a non-trivial amount of investigative and/or engineering work to built this capability to support Seisware SEG-Y.

from segpy.

rob-smallshire avatar rob-smallshire commented on July 26, 2024

Intriguingly, the bytes starting at 0-based offset 3500, where you would expect to find the SEG-Y version number are:

74 65 73 74 53 57

which decode in ASCII as:

 testSW

which I presume means "test software".

from segpy.

abingham avatar abingham commented on July 26, 2024

which I presume means "test software".

Or "test seisware". This is quite a rabbit hole!

from segpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.