<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello Sunil,<br><br>The WSAC0() function will write more complete header
information than WSAC1(). You will need to use it in conjunction with
the functions NEWHDR() and SET?HV(). <br>Here is an example of how I populate a header. I doubt this is the most elegant way to do it, but it seems to work:<br><br>.<br>.<br>.<br>/* Add header values */<br> newhdr();<br> setnhv("NPTS", & np, & NERR, 4);<br> setfhv("DELTA" , & DEL, & NERR, 5);<br> setfhv("B" , & BEG, & NERR, 1);<br> setfhv("STLA", & STLA, & NERR, 4);<br> setfhv("STLO", & STLO, & NERR, 4);<br> setfhv("EVLA", & EVLA, & NERR, 4);<br>
setfhv("EVLO", & EVLO, & NERR, 4);<br> setfhv("EVDP", & EVDP, & NERR, 4);<br> setfhv("MAG", & MAG, & NERR, 3);<br> setfhv("O", & O, & NERR, 1);<br> setkhv("KSTNM" , kstnm , & NERR , 5 , strlen(kstnm));<br> setnhv("NZYEAR", & NZYEAR, & NERR, 6);<br> setnhv("NZJDAY", & NZJDAY, & NERR, 6);<br> setnhv("NZHOUR", & NZHOUR, & NERR, 6); <br> setnhv("NZMIN", & NZMIN, & NERR, 5);<br> setnhv("NZSEC", & NZSEC, & NERR, 5);<br> setnhv("NZMSEC", & NZMSEC, & NERR, 6);<br><br> /* Use SAC libraries to write the binaries: */<br> strcpy(KCMPNM, "N"); // N-S component<br> setkhv("KCMPNM" , KCMPNM, & NERR , 6 , strlen(KCMPNM));<br>
wsac0(sacN, T, N, & NERR, strlen(sacN));<br>.<br>.<br>.<br><br>Good Luck!<br>Ken<br><br><br>Kenneth A. Macpherson<br>Research Fellow<br>Earth Observatory of Singapore (EOS)<br>Nanyang Technological University<br>50 Nanyang Avenue, Block N2-01a-15, Singapore 639798 <br>Telephone: (65) 6592 1772<br><br>--- On <b>Sun, 12/25/11, Sunil Roy <i><seismo_003@rediffmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Sunil Roy <seismo_003@rediffmail.com><br>Subject: [SAC-HELP] Not able to get complete header information by using C code<br>To: "sac-help@iris.washington.edu" <sac-help@iris.washington.edu><br>Date: Sunday, December 25, 2011, 8:12 AM<br><br><div id="yiv1743252368">I am writing C code to read sac file.<br>But what I have found that my out put sac file<br>does not contain all the header information as to my input sac file. <br><br>I am using
<br>wsac1 (kname, yarray, & npts, &beg, &del, &nerr, strlen( out ));<br>to write it to the sac header.<br><br>Did i am doing some wrong or probably my code is not complete.<br>how to write the complete header information.<br><br>my read (in) header info<br> NPTS = 35999<br> B = 0.000000e+00<br> E = 1.799900e+03<br> IFTYPE = TIME SERIES FILE<br> LEVEN = TRUE<br> DELTA = 5.000000e-02<br> DEPMIN = -1.670385e+04<br> DEPMAX = 1.073576e+04<br> DEPMEN = -3.021250e-01<br> OMARKER =
-675.06<br> T1MARKER = 115.61 (Pdiff)<br> T7MARKER = 704.17 (SKS)<br> T8MARKER = 751.13 (SKKS)<br> T9MARKER = 1277.3 (PKKS)<br> KZDATE = JUL 29 (210), 2011<br> KZTIME = 07:53:37.694<br> KSTNM = ADKI<br> CMPAZ = 0.000000e+00<br> CMPINC = 9.000000e+01<br> STLA = 1.584456e+01<br> STLO =
7.996883e+01<br> STEL = 4.900000e+01<br> EVLA = -2.378000e+01<br> EVLO = 1.797600e+02<br> EVDP = 5.230000e+05<br> DIST = 1.168606e+04<br> AZ = 2.809172e+02<br> BAZ = 1.108402e+02<br> GCARC = 1.049953e+02<br> LOVROK = TRUE<br> USER1 = 2.543314e+02<br> USER7 = 2.541673e+02<br> USER8 = 4.006796e+02<br> USER9 = 1.573983e+02<br>
NVHDR = 6<br> NWFID = 1<br> LPSPOL = FALSE<br> LCALDA = TRUE<br> KCMPNM = BHN<br> MAG = 6.700000e+00<br><br>my write (out) sac header info<br> NPTS = 35999<br> B = 0.000000e+00<br> E = 1.799900e+03<br> IFTYPE = TIME SERIES FILE<br> LEVEN = TRUE<br> DELTA = 5.000000e-02<br> DEPMIN = -1.670385e+04<br> DEPMAX = 1.073576e+04<br> DEPMEN = -3.021250e-01<br> KSTNM = sta<br> LOVROK =
TRUE<br> NVHDR = 6<br> LPSPOL = FALSE<br> LCALDA = TRUE<br> KCMPNM = Q<br><br>Thanks for help<br><br>Sunil Roy<br>Seismological Observatory <br>National Geophysical Research Institute<br>Hyderabad, India<br><br><a rel="nofollow" target="_blank" href="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?"><img src="http://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/signatureline.htm@Middle"></a><br><table border="0" cellpadding="0" cellspacing="0" width="578"><tbody><tr><td><span style="font-family:Arial, Helvetica, sans-serif;font-size:12px;color:#393939;">Follow <span style="color:#0000CC;"><b><u><a rel="nofollow" target="_blank"
href="http://track.rediff.com/click?url=___http://dealhojaye.rediff.com?sc_cid=rediffmailsignature___&cmp=signature&lnk=rediffmailsignature&newservice=deals">Rediff Deal ho jaye!</a></u></b></span> to get exciting offers in your city everyday.</span></td></tr></tbody></table></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>sac-help mailing list<br><a ymailto="mailto:sac-help@iris.washington.edu" href="/mc/compose?to=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></div></blockquote></td></tr></table>