questions about removing instrumental response

Hi,

    I am a newbee to obspy and have a “dumb” question for removing instrumental response. However, my sac codes and python codes seem to give different waveforms. What’s wrong with my python codes? Thanks.

Here is my python codes:

from obspy.fdsn import Client
from obspy import UTCDateTime
client = Client()
t = UTCDateTime("2010-08-10T05:35:46")
st = client.get_waveforms("TA", "R11A", "", "BHZ", t, t + 100 * 60,attach_response=True)
st_raw = st.copy()
st.remove_response()
st_raw.plot()
st.plot()

Here is my sac codes:

r TA.R11A.BHZ
rmean
rtrend
taper
trans from polezero subtype SAC.TA.R11A to none freq 0.001 0.002 0.1 0.2
w over

Yuanyuan Liu

Hi,
Check the python function: "correctStreams" at this link: https://github.com/nikosT/scisola/blob/master/scisola/src/lib/stream.py

Best Regards,

Hi Yuanyuan,

judging from your SAC codes I'd adapt your Python code like..

st.detrend("demean")
st.detrend("linear")
st.remove_response(zero_mean=False, taper=True,
                   pre_filt=(0.001, 0.002, 0.1, 0.2))

If that still doesn't match well enough, probably the fine tuning with
tapering and detrending options has to be further tweaked, I am not sure
about the SAC settings for those right now.
Also see the documentation of the respective functions for details, e.g.:
http://docs.obspy.org/packages/autogen/obspy.core.trace.Trace.remove_response.html?highlight=remove_response#obspy.core.trace.Trace.remove_response

best,
Tobias

Hi Tobia,

Thank you for your reply. The final waveforms from two methods (attached) are similar now, but the amplitude are quite different. Do you have any idea what might have caused this?

Python codes:

from obspy.core import read
from obspy.fdsn import Client
from obspy import UTCDateTime

client = Client()
t = UTCDateTime(“2010-08-10T05:35:46”)
st = client.get_waveforms(“TA”, “R11A”, “”, “BHZ”, t, t + 100 * 60,attach_response=True)
st.detrend(type=“demean”)
st.detrend(type=“linear”)
st.remove_response(zero_mean=False, taper=True,pre_filt=(0.001, 0.002, 0.1, 0.2))
st.filter(‘bandpass’, freqmin=0.0306, freqmax=0.0374, corners = 2, zerophase=True)
st.plot(outfile='python.ps’)

sac codes are the same with last mail:

r TA.R11A.BHZ

python.ps (53.8 KB)

sac.ps (6.82 MB)

Hi,

I just realized that the y axis of output from python must be displacement, to be consistent with sac output (transfer to none). Thus i added this to the python codes:

st.remove_response(output=“DISP”,zero_mean=False, taper=True,pre_filt=(0.001, 0.002, 0.1, 0.2))

The final outputs from two methods are almost the same.
Am I doing the right thing? Thanks.

sac.ps (6.82 MB)

python.ps (53.8 KB)