Attach tr.stats.paz AttribDict to trace from SAC paz_file
This is experimental code, taken from obspy.gse2.libgse2.attach_paz and adapted to the SAC-pole-zero conventions. Especially the conversion from velocity to displacement and vice versa is still under construction. It works but I cannot guarantee that the values are correct. For more information on the SAC-pole-zero format see: http://www.iris.edu/software/sac/commands/transfer.html. For a useful discussion on polezero files and transfer functions in general see: http://www.le.ac.uk/seis-uk/downloads/seisuk_instrument_resp_removal.pdf. Also bear in mind that according to the SAC convention for pole-zero files CONSTANT is defined as: digitizer_gain*seismometer_gain*A0. This means that it does not have explicit information on the digitizer gain and seismometer gain which we therefore set to 1.0.
Attaches to a trace a paz AttribDict containing poles zeros and gain.
Parameters: |
|
---|
>>> from obspy import Trace
>>> tr = Trace()
>>> import StringIO
>>> f = StringIO.StringIO("""ZEROS 3
... -5.032 0.0
... POLES 6
... -0.02365 0.02365
... -0.02365 -0.02365
... -39.3011 0.
... -7.74904 0.
... -53.5979 21.7494
... -53.5979 -21.7494
... CONSTANT 2.16e18""")
>>> attach_paz(tr, f,torad=True)
>>> print(tr.stats.paz['zeros'][0])
(-31.6169884657+0j)