Thread: lost headers?

Started: 2012-01-21 15:43:15
Last activity: 2012-01-22 04:51:47
Topics: SAC Help
Steve Gao
2012-01-21 15:43:15

Hi,

My understanding was that wsac1 keeps all the header values from the most recent rsac1 call? However, in the following example, file tmp1.z lost all its event/station coordinates and related headers.

Any hints? Thanks. Steve Gao

------------------------------------


nin1='tmp.z'
call rsac1(nin1, x, npts, beg, delta, max, nerr)

nin1='tmp1.z'

call wsac1(nin1, x, npts, beg, delta, nerr)






  • Arthur Snoke
    2012-01-22 04:51:47
    My understanding was that wsac1 keeps all the header values from the
    most recent rsac1 call? However, in the following example, file tmp1.z
    lost all its event/station coordinates and related headers.

    No. wsac1 and wsac2 write "minimum headers." wsac0 writes full headers
    and includes updates to header values for a SAC file that had been read in
    and then processed.

    We found that the help command for the last couple of versions was
    incomplete so did not explain and give examples for the various read and
    write routines. That will be corrected in v101.5b -- coming soon.

    WSAC1 writes evenly spaced files
    WSAC2 writes unevenly spaced and spectral files
    WSAC0 writes either format but has more comprehensive header files
    than the other two

    WSAC1 and WSAC2 write SAC files with a minimum header contains only those
    variables needed to be able to read the file: B, E, DELTA, LEVEN, and
    NPTS. For calls to WSAC0, If it is a new file, it requires a call to
    subroutine NEWHDR supplemented by additional header variables to be set
    using the SETXXX routines (see examples below). If it is writing to a file
    that is based on one that had been read in previously in the program, one
    should not call NEWHDR. Before writing such a file using WSAC0, SAC
    updates the header variables such as DEPMAX and BAZ. As shown in the
    examples below, the type of SAC data file that gets written depends on
    header variables that must be set: IFTYPE and LEVEN. IFTYPE has the
    following values:

04:37:49 v.b4412d20