[sac-dev] byte order and swapping
Brian Savage
savage13 at dtm.ciw.edu
Mon Nov 21 07:51:17 PST 2005
There appears to be two camps concerning this. Either way, we need to
make a decision about byte order and create the read and write routines
to handle them.
At present we still have a problem with the readhdr/writehdr routines
and this needs to be fixed.
My own personal opinion is this. When sac was developed it used the
native format for Sun (Big endian) and this was fine. Livermore had not
decided if big endian was the standard format and thus moving to the
linux (little endian format) allowed for sac files to be in another byte
order. Allowing for two different formats is the easiest and least
instrusive thing to do. Not to be rude, but I think Livermore has
inadvertently made our bed for us.
Swapping massive amounts of data or rewriting software to conform to a
standard introduced part way into the game is something none of us would
like to do. Do not force others to do it.
Brian
George Helffrich wrote:
> 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
>
> _______________________________________________
> sac-dev mailing list
> sac-dev at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-dev
More information about the sac-dev
mailing list