[sac-dev] byte order and swapping
George Helffrich
george at gly.bris.ac.uk
Sun Nov 20 07:16:11 PST 2005
The byte-swapping/header rewriting issue highlights a problem that SAC
still has, to wit:
there is no specification as to what the byte order in SAC files is.
By accident, there is a reliable way to tell the endianness of a SAC
data file due to the known format of the data file header. However,
there is no analogous way to tell what the endianness of a SAC SGF file
is reliably. So the present situation provides a workable, yet
complicated solution for SAC data, but none for SGF.
If we decide, as a community, this endianness issue, then the issues
with byte-swapped headers vs data disappears. The only reason it
exists is because we never have answered the endianness question.
So why not specify it?
Based on the historical fact that SAC was developed on Ridge and Sun
machines -- both big-endian -- there is an argument for files being
big-endian. However, both Macs and PCs are converging towards
little-endian order, so a more practical choice might be little.
Does anybody object to or disagree with the need to specify a byte
order?
George Helffrich
More information about the sac-dev
mailing list