obspy.io.sac.sacpz.attach_resp
- attach_resp(tr, resp_file, todisp=False, tovel=False, torad=False, tohz=False)[source]
Extract key instrument response information from a RESP file, which can be extracted from a dataless SEED volume by, for example, using the script obspy-dataless2resp or the rdseed program. At the moment, you have to determine yourself if the given response is for velocity or displacement and if the values are given in rad or Hz. This is still experimental code (see also documentation for
obspy.io.sac.sacpz.attach_paz()
). Attaches to a trace a paz AttribDict containing poles, zeros, and gain.- Parameters:
tr – An ObsPy
Trace
objectresp_file – path to RESP-file or file pointer
todisp – change a velocity transfer function to a displacement transfer function by adding another zero
tovel – change a displacement transfer function to a velocity transfer function by removing one 0,0j zero
torad – change to radians
tohz – change to Hertz
>>> from obspy import Trace >>> import os >>> tr = Trace() >>> respfile = os.path.join(os.path.dirname(__file__), 'tests', 'data', ... 'RESP.NZ.CRLZ.10.HHZ') >>> attach_resp(tr, respfile, torad=True, todisp=False) >>> for k in sorted(tr.stats.paz): ... print(k) digitizer_gain gain poles seismometer_gain sensitivity t_shift zeros >>> print(tr.stats.paz.poles) [(-0.15931...+0.15931...j), (-0.15931...-0.15931...j), (-314.159...+202.318...j), (-314.159...-202.318...j)]