Jonathan,
these header fields are autoset by the SAC software, if the LCALDA flag in the sac header is set to true.
(http://ds.iris.edu/files/sac-manual/manual/file_format.html)
The question is whether or not ObsPy should do the same and autoset those fields.
Claudio
Oops, I read the email too quickly...
This is easy enough to change, but for some reason it causes a failure in the realtime.rttrace module tests. In the meantime, you can use this snippet to get an ObsPy Trace with the distances set:
from obspy.io.sac import SACTrace
sac = SACTrace.read('XX.LSo1.00.SHX')
sac._set_distances()
tr = sac.to_obspy_trace()
You could also use this snippet to redefine the “read” function at the top of your code, so that distances are automatically set whenever you call the “read” function on a SAC file.
I’ll look into the test failure and submit a fix this weekend.
Best,
Jon