5.12.1.1. eqcorrscan.utils.sac_util.sactoevent

eqcorrscan.utils.sac_util.sactoevent(st, debug=0)[source]

Convert SAC headers (picks only) to obspy event class. Picks are taken from header values a, t[0-9].

Parameters:st (obspy.core.stream.Stream) Stream of waveforms including SAC headers.
Pram debug:Debug level, larger number = more output.
Returns:obspy.core.evebt.Event

Note

This functionality is not supported for obspy versions below 1.0.0 as references times are not read in by SACIO, which are needed for defining pick times.

Note

Takes the event origin information from the first trace in the stream - to ensure this works as you expect, please populate the evla, evlo, evdp and nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec for all traces with the same values.

>>> from obspy import read, UTCDateTime
>>> st = read('eqcorrscan/tests/test_data/SAC/2014p611252/*')
>>> event = sactoevent(st)
>>> print(event.origins[0].time)
2014-08-15T03:55:21.057000Z
>>> print(event.picks[0].phase_hint)
S