Thread: GETFHV Read Error

Started: 2010-03-18 16:08:19
Last activity: 2010-03-18 17:02:51
Topics: SAC Help
Andrew Schaeffer
2010-03-18 16:08:19
Hi,

I am using the LIBSAC libraries to read header values into a fortran code. I
am having trouble reading in the 'dist' header field.

The rsac call in the fortran code does not return an error, as other header
values can be read. The call to get the 'dist' header value is:
call getfhv('dist',dist,nerr)

But when running on a sac file, I get an error saying that the field is
undefined...
ERROR 1336: Undefined header field value. dist

However, when I use sac and open this same file and list the header values,
there is a defined value present for this header.
$ sac << EOF
r compR.lhn
lh dist delta
q
EOF
SEISMIC ANALYSIS CODE [08/24/2009 (Version 101.3b)]
Copyright 1995 Regents of the University of California



FILE: compR.lhn - 1
---------------------------

dist = 8.346584e+03
delta = 1.000000e+00
$

This error only seems to happen for the 'dist' field. Unless of course the
value is truly undefined and also does not appear in a sac 'lh' command.

Any insight would be much appreciated.

cheers,
Andrew Schaeffer

  • Brian Savage
    2010-03-18 17:02:51
    Andrew,

    I would first suggest doing the following commands in sac.

    read compR.lhn
    write over
    quit

    When sac reads a file, it will compute location parameters and max/min/
    mean values if it can. The sacio library does not do this
    automatically, but it probably should.

    If this does not work, then we have problems.

    Brian
    savage<at>uri.edu

    On Mar 18, 2010, at 5:08 AM , Andrew Schaeffer wrote:

    Hi,

    I am using the LIBSAC libraries to read header values into a fortran
    code. I am having trouble reading in the 'dist' header field.

    The rsac call in the fortran code does not return an error, as other
    header values can be read. The call to get the 'dist' header value is:
    call getfhv('dist',dist,nerr)

    But when running on a sac file, I get an error saying that the field
    is undefined...
    ERROR 1336: Undefined header field value. dist

    However, when I use sac and open this same file and list the header
    values, there is a defined value present for this header.
    $ sac << EOF
    r compR.lhn
    lh dist delta
    q
    EOF
    SEISMIC ANALYSIS CODE [08/24/2009 (Version 101.3b)]
    Copyright 1995 Regents of the University of California



    FILE: compR.lhn - 1
    ---------------------------

    dist = 8.346584e+03
    delta = 1.000000e+00
    $

    This error only seems to happen for the 'dist' field. Unless of
    course the value is truly undefined and also does not appear in a
    sac 'lh' command.

    Any insight would be much appreciated.

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


01:52:17 v.22510d55