Thread: Fwd: sac website

Started: 2008-01-29 01:22:17
Last activity: 2008-01-29 17:20:12
Topics: SAC Help
Yingcai Zheng
2008-01-29 01:22:17
is there a flag in a SAC file that can tell the file is BIG_ENDIAN or
LITTLE_ENDIAN?
thanks.
ying cai

  • Brian Savage
    2008-01-29 17:20:12
    Ying Cal

    There is currently no easy way to check the endianness of a sac file
    directly, but

    What you can do is something like
    % od -j 304 -N 4 -t d4 sacfile
    0000460 6
    0000464

    % od -j 304 -N 4 -t d4 sacfile.swap
    0000460 100663296
    0000464

    It outputs the header version number, which should be 6. If it is
    not 6 (100663296 or anything else)
    then you either have a byte swapped sac file or the file is not a
    sacfile. This will only tell you if
    the file you are looking at is the same endianness as your system.

    The current version of SAC (101.1) can read and write both types of
    sac files.

    Cheers,
    Brian



    On Jan 28, 2008, at 6:22 PM , Yingcai Zheng wrote:

    is there a flag in a SAC file that can tell the file is BIG_ENDIAN
    or LITTLE_ENDIAN?
    thanks.
    ying cai



    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


05:09:53 v.22510d55