[obspy-users] Obspy 1.0.0 sac header issues

Charles Ammon cja12 at psu.edu
Wed Mar 23 12:47:45 CET 2016


Hi,

I am finally getting around (being forced) to change a set of scripts to 
adjust to the latest updates to obspy and came across a number of 
issues.

The first issue has been discussed in February 2016, and is related to 
setting sac-header location fields (stla, stlo, evla, evlo). Initially, 
all these items have values of -12345 (this is a SAC default for unset 
header values). When I set one of the items, say stlo, it appears that 
obspy tries to compute the distance and azimuth using the existing 
-12345 values, which throws an exception from the distance-azimuth 
calculation ('out of bounds', because -12345 is not in the geographic 
range). Unless you are handling/suppressing the exception, it can toss 
you out of the current section of your code.

To work around that problem/feature, set lcalda = False, set the 
location fields and then set lcalda = True. I am not sure rushing off to 
compute the distance and azimuth is the right thing to do in a header 
access implementation unless none of the key lats and lons equal -12345. 
This could be checked in the code if you want to keep the current 
approach. Or, am I missing something?

Also, I am perplexed by why i cannot store a value in the 'evdp' header 
field. The documentation states that this is "not used", but it is an 
essential piece of the header. From the documentation:

	"Event depth below surface (meters). [not currently used]"

	http://docs.obspy.org/packages/autogen/obspy.io.sac.sactrace.SACTrace.html#obspy.io.sac.sactrace.SACTrace

If I don't store an earthquake depth in 'evdp' where is depth 
information supposed to be stored? What am I missing here?

Chuck Ammon

================================i====================================
Charles J. Ammon, Department of Geosciences
Penn State University / 440 Deike Bldg / University Park, PA 16802
VOICE: (814) 865 2310  / FAXES: (814) 863 7823 or (814) 863 8724
http://eqseis.geosc.psu.edu/~cammon/
http://www.personal.psu.edu/faculty/c/j/cja12/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20160323/42898e29/attachment.html>


More information about the obspy-users mailing list