[SAC-HELP] dealing with big-endian and little-endian data with SAC and sacswap

Marcelo Bianchi m.tchelo at gmail.com
Wed Oct 13 07:06:00 PDT 2010


Hi

You could take a look at a small program that I wrote that can do it for
you. The name of the program is sacswapbyte.
You can check it from my webpage ...

http://sites.google.com/site/foo4funreborn/

>From this program you can pass in many files and say that I want that the
output should be little or big and will find out wich files need to be
converted and those that should not be changed. Also there are other tools
(sactools) on my webpage for handling large amounts of sacdata in one run.
Like make tables of header variables or renaming sac files ... well have a
look !

regards,

marcelo
--
Mobile ~ +47 9080 6225
http://sites.google.com/site/foo4funreborn/



2010/10/13 Derek Schutt <Derek.Schutt at colostate.edu>

>  It's been a while since I worried about this, and I've screwed things up a
> bit.
>
> I requested some data from the DMC, using Standing Order for Data (SOD).
> It is big-endian.   When I write a sac file on my x86 computer, the sac file
> seems to be in little-endian format (the native format); however, when I
> just write headers to the original sac file, the file stays in the
> big-endian format.
>
> I'd like all my data to be in one format, preferably the native,
> little-endian, format.   I can use sacswap to change format, but it seems to
> work indiscriminantly on files, swapping them even if they are in the native
> format.
>
> So, I was wondering:
>    1) If there is any way to make sac write files in the same byte-order
> that the file was read in
>    2) is there a more elegant way to work with sacswap, to get it to only
> swap non-native byte order files.   I think the mac version of sacswap does
> do this.
>
> I realize now I should have used the <littleEndian/> tag in my SOD request,
> and it's actually not to hard to retrace my steps and run sacswap on the
> files that need to be swapped.   But I can't help if there is a more elegant
> way to do this...
>
> Thanks,
>
> Derek
>
> --
> --------------------
> Derek Schutt
> Assistant Professor
> Geosciences Department
> 309 Natural Resources Building
> Campus Delivery 1482
> Fort Collins, CO 80525-1482
> http://warnercnr.colostate.edu/~schutt/CSU_web/index.htm<http://warnercnr.colostate.edu/%7Eschutt/CSU_web/index.htm>
> 970-491-5786
>
> _______________________________________________
> sac-help mailing list
> sac-help at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20101013/c764ba9e/attachment.html>


More information about the sac-help mailing list