obspy.io.sac.sactrace.SACTrace.from_obspy_trace

classmethod SACTrace.from_obspy_trace(trace, keep_sac_header=True)[source]

Construct an instance from an ObsPy Trace.

Parameters:
  • trace (Trace) – Source Trace object

  • keep_sac_header (bool) – If True, any old stats.sac header values are kept as is, and only a minimal set of values are updated from the stats dictionary: npts, e, and data. If an old iztype and a valid reftime are present, b and e will be properly referenced to it. If False, a new SAC header is constructed from only information found in the stats dictionary, with some other default values introduced.