<div>Here are a couple links describing the format:</div><div><br></div><div><a href="http://www.iris.edu/manuals/sac/SAC_Manuals/FileFormatPt1.html">http://www.iris.edu/manuals/sac/SAC_Manuals/FileFormatPt1.html</a></div>
<a href="http://www.iris.edu/KB/questions/13/SAC+file+format">http://www.iris.edu/KB/questions/13/SAC+file+format</a><br><br><div>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.</div>
<div><br></div><div>Don't want to use the library? Read on...</div><meta charset="utf-8"><div>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.</div>
<div><br></div><div>I've been working on a wiki for seismology:</div><div><a href="http://seismowiki2.pbworks.com/w/page/28169580/Data-Processing">http://seismowiki2.pbworks.com/w/page/28169580/Data-Processing</a></div>
<div>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).</div><div><a href="http://seismowiki2.pbworks.com/f/porritt_broadband_processing_matlab.zip">http://seismowiki2.pbworks.com/f/porritt_broadband_processing_matlab.zip</a></div>
<div>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.</div>
<div><br></div><div>Cheers,<br>Rob Porritt</div><div>Berkeley Seismological Laboratory</div><div>UC Berkeley</div><div><br></div><div><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 7:02 PM, Donghoon Lee <span dir="ltr"><<a href="mailto:physics6@gmail.com">physics6@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Hello, this is Lee.<br>
<br>
I want to build my own SAC read-write program. Like a Guralp guys did.<br>
<br>
But I can't find information about detailed SAC file format structure.<br>
<br>
I want more detailed structure information. Like SEED manual.<br>
<br>
Do you have a SAC file format structure manual? Or something detailed<br>
description?<br>
<br>
If not, can you tell me how guralp guys did it?(I mean, SCREAM!<br>
program..It can export data in SAC format.)<br>
<br>
<br>
Thank you.<br>
<br>
Lee.<br>
<br>
_______________________________________________<br>
sac-help mailing list<br>
<a href="mailto:sac-help@iris.washington.edu">sac-help@iris.washington.edu</a><br>
<a href="http://www.iris.washington.edu/mailman/listinfo/sac-help" target="_blank">http://www.iris.washington.edu/mailman/listinfo/sac-help</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Rob Porritt, GG<br>UC Berkeley Earth and Planetary Sciences PhD Candidate<br>Berkeley Seismological Laboratory<br><a href="http://seismo.berkeley.edu/~rob/">http://seismo.berkeley.edu/~rob/</a><br>
</div>