Headers not updated in SAC files

Hi all:

While reading and writing sac files with obspy, I encountered a similar problem posted on the obspy forum in March 2014 (http://lists.swapbytes.de/archives/obspy-users/2014-March/001306.html).

In my case, the sac headers are not updated on obspy and I could not write to file the dist, az and baz computed in obspy. As a result, I manually input the stlo, stla, evlo and evla, into the obspy file. However, after writing the obspy mseed file in sac format, sac should automatically calculate the distance header, but this is not happening.

As suggested in the response (http://lists.swapbytes.de/archives/obspy-users/2014-March/001307.html), I tried the ‘wh’ option in SAC but the DIST, AZ and BAZ still were not computed, I am not sure if this is related to how obspy writes the output sac file.

I would appreciate anyone’s help.

Thank you,


University of Victoria

Hi Ayodeji,
I believe that the SAC header variable LCALDA determines whether the DIST/GCARC/AZ/BAZ are calculated at load time for the SAC file. Make sure that in obspy, your LCALDA variable is still set to “True” before writing the sac file from obspy. If you’re reading in miniseed files, which don’t have an LCALDA header value, then this may be filled as false by default.

Hi Andrew,
Thanks! I didn’t remember that header variable; I’d fix it and try again.
Have a great week.