Instrument Response question

Dear users,

Could anyone kindly help with my question?

I remove instrument response by first getting the inventory from get_station, attaching inventory to the stream using attach_response and finally, remove_response. This assumes that the relevant response file is available through the datacenter.

If the response file is not available through the datacenter but on my local, how do I attach the response file to stream as inventory and remove response?

Thanks!

Ayodeji

Hi Ayodeji,

please try not to use the attach_response() method anymore. We keep it around for compatibility reason but it was a design mistake in retrospect. The remove_response() method has an inventory argument which takes an ObsPy inventory object with the response information. You can get that either from a datacenter or just by using obspy.read_inventorty() on a local file in one of the supported data format.

All the best,

Lion

Hi Lion,

Thanks for the response!
Will give it a try.

I’ve used the attach_response function for a long time now, hope results produced with it are OK?

Thanks!

Ayodeji

Hi Ayodeji,

yes of course. The attach_response() function yields the correct result but it is just not a nice API.

Cheers!

Lion

To give some more info on the topic:

Stream.attach_response() (followed directly by "remove_response()") is
working exactly the same as Stream.remove_response(inventory=...).

Only if you make manual metadata changes or merge Traces etc in between,
there are some potentially dangerous scenarios with the "attaching the
response to traces approach" and it is so incredibly way safer to always
look up response information for every Trace dynamically, on-the-fly,
all the time.

The attach_response() routine was a design mistake we plan to deprecate
and will remove in some future major release for safety reasons.

T