[SAC-HELP] Hellp, This is Lee. I have a question about SAC file format structure

Rob Porritt rob at seismo.berkeley.edu
Wed Dec 22 19:30:26 PST 2010


Here are a couple links describing the format:

http://www.iris.edu/manuals/sac/SAC_Manuals/FileFormatPt1.html
http://www.iris.edu/KB/questions/13/SAC+file+format

There are library routines in the sac libraries included with the sac
download. Your best bet is to link against the library and call rsac1 or
wsac1.

Don't want to use the library? Read on...
Its basically a block of metadata (158 32-bit words) and then just a block
of floating point values. The typical method you could employ is to read the
header block, check against bit-swapping, and then read the data-only part.
You would then return the data array and header structure to your main
routine.

I've been working on a wiki for seismology:
http://seismowiki2.pbworks.com/w/page/28169580/Data-Processing
on this site I've posted a tutorial for basic matlab functions which mimic
sac (better just to compile SAC in a method to play nicely with matlab, but
this helps illustrate some concepts).
http://seismowiki2.pbworks.com/f/porritt_broadband_processing_matlab.zip
included in the 'functions' folder of this zip file are ones called
readsac.m, load_sac.m, and write_sac.m which I've altered slightly from the
original codes to account for bit swapping. If you're familiar with Matlab,
you could mimic the general methods of those codes for your language of
choice.

Cheers,
Rob Porritt
Berkeley Seismological Laboratory
UC Berkeley


On Wed, Dec 22, 2010 at 7:02 PM, Donghoon Lee <physics6 at gmail.com> wrote:

>   Hello, this is Lee.
>
>   I want to build my own SAC read-write program. Like a Guralp guys did.
>
>   But I can't find information about detailed SAC file format structure.
>
>   I want more detailed structure information. Like SEED manual.
>
>   Do you have a SAC file format structure manual? Or something detailed
>  description?
>
>   If not, can you tell me how guralp guys did it?(I mean, SCREAM!
>  program..It can export data in SAC format.)
>
>
>   Thank you.
>
>   Lee.
>
> _______________________________________________
> sac-help mailing list
> sac-help at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-help
>



-- 
Rob Porritt, GG
UC Berkeley Earth and Planetary Sciences PhD Candidate
Berkeley Seismological Laboratory
http://seismo.berkeley.edu/~rob/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20101222/2d3f092f/attachment.html>


More information about the sac-help mailing list