Thread: Re: doubles in sac

Started: 2007-11-29 20:13:20
Last activity: 2007-11-29 20:13:20
Topics: SAC Developers
Brian Savage
2007-11-29 20:13:20

Taking a walk through the source code is interesting.

Many of the internal processing subroutines assume the data are
floats (single precision).
The filtering portion of the code is a good example, bandpass,
lowpass, etc...

All of the subroutines involved in reading and writing assume a
specific size, and
many places in these routines assume a four byte floating point and
have this
value hard coded in. For example, the version number is at a
specific byte location
in the sac header (76 bytes in).

I am not saying it would be impossible, but would take some work and
to accommodate double precision for either the data or header or both.


On Nov 29, 2007, at 7:49 AM , Arthur Snoke wrote:

I used the wrong address for the sac-help listserv.

---------- Forwarded message ----------
Date: Wed, 28 Nov 2007 22:49:36 -0500 (EST)
From: Arthur Snoke <snoke<at>>
To: Tim Ahern <tim<at>>, Brian Savage
Robert B. Herrmann <rbh<at>>
Cc: sac-help-request<at>
Subject: Re: [SAC-HELP] doubles in sac

Tim and others,

Bob touched on what I think is the biggest problem in modifying
sac: the header is fixed in length so one could not easily double
all the floats.

The simplest interim solution as I see it that would allow sac to
continue to live is to have rdseed spew out single precision to a
sac format. Except for timing as in Bob's example or in very high
sample rates in general, where are doubles needed?


On Wed, 28 Nov 2007, Robert B. Herrmann wrote:

sac-help-request<at> wrote:
Tim: I do not know if this response will get back to the mailing
list - so you get a copy
If the data stream should be modified to have doubles for the
data, we should also consider doubles for the SAC float header
values - One CANNOT pick time correctly at 23:59:59 for 200 Hz
data sets (I know this is extreme) is the continuous data stream
starts at 00:00:00 - the seven digit accuracy of floating point is
One would just need to redefine a new header version - I believe
tha tthe current header is at version 7
Given a define change, gsac would have it implemented in about one
hour. Internally gsac uses doubles for the float header values.
Date: Wed, 28 Nov 2007 11:41:39 -0800
From: Tim Ahern <tim<at>>
Subject: [SAC-HELP] Double Precision
To: sac-help<at>
Cc: Doug Neuhauser <doug<at>>, Robert Uhrhammer
<bob<at>>, Chris Laughbon
Charley Weiland <cweiland<at>>
We have a question for the SAC users group. Recently a need to
support double precision floating point for data in SEED format
has been identified. While SEED itself can support this, the
problem comes with possible output formats the rdseed program
should support. The most widely used format is SAC format in our
Our question is, is it possible for SAC to support double
precision floating point values without loosing precision? Would
it be extremely difficult to add double precision support for
SAC? Even if SAC can not support the format, would it make sense
to have a double precision version of the SAC Format, if you
understand what I mean by that.
One further question is, assuming that SAC and SAC format are not
ready for double precision and it would be difficult to support
it... what new format do you think we might consider supporting
as an output format for rdseed? Do any of you have suggestions as
to possible ways to deal with double precision floats as an
output format?
Thanks for any help you can provide us.
sac-help mailing list

13:57:58 v.01697673