Thread: get header data

Started: 2006-10-09 23:03:04
Last activity: 2006-10-10 16:29:53
Topics: SAC Help
Heloise.Cadet@ujf-grenoble.fr
2006-10-09 23:03:04

Good morning,

I'd like to get some information in the header but the subroutines getfhv
doesn't seem to work for depmin, depmax and dist

in a fortran code:

call GETFHV ('DEPMIN', depmin, nerr)

I got this error message:
ERROR: Undefined header field value. DEPMIN

but it works for:

call GETNHV ('NZYEAR', nyear, nerr)

is there a bug? or an other way to extract data from the header?

Best regards

Héloïse
CETE Nice, LGIT Grenoble




  • Peter Goldstein
    2006-10-10 01:02:14

    As Art suggests, saclst will hopefully provide
    the header list capabilities you need.
    In the short term you can hopefully get by using listheader within a script and
    redirect the output to the file you want.

    Something like the following script could be invoked as
    sac_lh.csh "your_filename"
    Note that the blank lines are needed to get all the headers and you'll
    still have to edit the results if you want a particular format or to get rid of
    extraneous information and blank lines.


    #!/bin/csh -xvf
    # sac_lh.csh: script to list sac header listing to standard out
    sac<<eof
    r $argv[1]
    lh inclusive on




    q
    eof
    # end of sac_lh.csh

    Good morning,

    I'd like to get some information in the header but the subroutines getfhv
    doesn't seem to work for depmin, depmax and dist

    in a fortran code:

    call GETFHV ('DEPMIN', depmin, nerr)

    I got this error message:
    ERROR: Undefined header field value. DEPMIN

    but it works for:

    call GETNHV ('NZYEAR', nyear, nerr)

    is there a bug? or an other way to extract data from the header?

    Best regards

    HÈloÔse
    CETE Nice, LGIT Grenoble



    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    --

    Peter Goldstein, Ph.D. (925) 423-1231 (office)
    L-103, PO Box 808 (925) 422-5844 (fax)
    Livermore, CA 94551 peterg<at>llnl.gov (email)
    web page: http://www.llnl.gov/sac


  • Frederik Tilmann
    2006-10-10 16:29:53
    Heloise

    these values all need to be calculated by sac so when the sac file is
    generated externally, e.g. by rdseed they are generally left undefined.

    Try reading into sac and writing again, i.e.

    sac<<eof
    r file
    w over
    q
    eof

    Of course, for dist evla,evlo,stla,stlo all need to be set and lcalda
    must be true.

    Frederik


    Heloise.Cadet<at>ujf-grenoble.fr wrote:
    Good morning,

    I'd like to get some information in the header but the subroutines getfhv
    doesn't seem to work for depmin, depmax and dist

    in a fortran code:

    call GETFHV ('DEPMIN', depmin, nerr)

    I got this error message:
    ERROR: Undefined header field value. DEPMIN

    but it works for:

    call GETNHV ('NZYEAR', nyear, nerr)

    is there a bug? or an other way to extract data from the header?

    Best regards

    H?lo?se
    CETE Nice, LGIT Grenoble



    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    --
    Frederik Tilmann
    Bullard Laboratories Tel. +44 1223 765545
    Department of Earth Sciences Fax. +44 1223 360779
    University of Cambridge email: tilmann<at>esc.cam.ac.uk
    Madingley Road
    Cambridge CB3 0EZ
    UK





Page built 06:27:12 | v.b'ea7a92