# 5.13.1.1. eqcorrscan.utils.sac_util.sactoevent

`eqcorrscan.utils.sac_util.``sactoevent`(st, debug=0)

  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. debug (int) Debug level, larger number = more output.
  Returns: | Event with picks taken from SAC headers.
  Return type: | `obspy.core.event.event.Event`

  Note

  This functionality is not supported for obspy versions below 1.0.0 as reference 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
      >>> 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