Skip to content

bug: segyio does not support ASCII headers, even though they are per-spec #583

Description

@sebastianvitterso

According to https://pubs.usgs.gov/of/2001/of01-326/HTML/FILEFORM.HTM (unsure of its official-ness), the text header of a SEG-Y file can either be encoded as EBCDIC or as ASCII. Most of the files we've used seem to have EBCDIC encoding, and segyio correctly handles these files. However, the other day we were greeted by a file with an ASCII header, and we were a bit stumped, as the header text suddenly seemed completely jumbled.
Looking quickly into segyio code, it seems that it always converts EBCDIC to ASCII, without checking that the contents are actually EBCDIC.

Now, the first character of the SEG-Y text header should be C (as in C 1, C 2 etc.), so looking up the numeric value and deciding whether it is EBCDIC or ASCII should be simple enough, it just has to be done.

Hope this is something we can get fixed in the library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions