remove_response

Dear All,

I have bee trying remove response from seed files.
I use the following script which is based on the tutorial example to remove response :

from obspy import read, read_inventory
st = read(“20180203_0000_z.msd")
tr = st[0]
inv = read_inventory(“CANO…HHZ.CMG_6TD.1.200.200.xml”)
pre_filt = [0.001, 0.005, 40, 80]
tr.remove_response(inventory=inv, pre_filt=pre_filt, output=“DISP”, water_level=60, plot=True)

The file(s) I’m trying remove response has 24h @ 200Hz

The error I get is the following:

Traceback (most recent call last):
File “rem_response.py”, line 14, in
tr.remove_response(inventory=inv, pre_filt=pre_filt, output=“DISP”, water_level=60, plot=True)
File “</Users/joaofontiela/anaconda3/envs/python2.7/lib/python2.7/site-packages/decorator.pyc:decorator-gen-28>”, line 2, in remove_response
File “/Users/joaofontiela/anaconda3/envs/python2.7/lib/python2.7/site-packages/obspy/core/trace.py”, line 235, in _add_processing_info
result = func(*args, **kwargs)
File “/Users/joaofontiela/anaconda3/envs/python2.7/lib/python2.7/site-packages/obspy/core/trace.py”, line 2730, in remove_response
response = self._get_response(inventory)
File “/Users/joaofontiela/anaconda3/envs/python2.7/lib/python2.7/site-packages/obspy/core/trace.py”, line 2561, in _get_response
raise ValueError(msg)
ValueError: No matching response information found.

I’m not sure perhaps error could be linked to StationXMl file … which was done using obspy.clients.nrl. Nevertheless, I tested stationXML file with read_inventory and I was able to read is contents.

Any help will be nice.

Thanks,
João Fontiela

Hello Joao,

You might not have a response that corresponds to your data. Without seeing your miniSEED file and station xml file, it is hard to say for sure. If you put them somewhere, I would be happy to look at them.

Best,
Adam

Hi Joâo,
Your StationXML should have the same station name, network code, location code, and the channel as the mseed file. I usually run the following piece of code before making the StationXML file from the NRL to extract these details from the mseed file.

staxns = read(‘my.mseed’)
seis = staxns.select(station=stnm)
print(seis)

Januka

Januka Attanayake

Research Fellow | Earthquake Seismology
Homepage: https://sites.google.com/site/janukaattanayake

School of Earth Sciences | McCoy Bldg. 200
University of Melbourne | Parkville 3010 VIC
Australia