Having a case of “this used to work” (prior to obspy 1.03, or at least I thought so!) with the instrument response removal of the Strasbourg gravimeter.
from obspy import UTCDateTime
from obspy.clients.fdsn import Client
client = Client(“IRIS”)
starttime = UTCDateTime(“2010-03-11:T05:46:00”)
endtime = starttime+48*3600
network=‘SG’
station=‘ST’
st=client.get_waveforms(network=network,station=station,starttime=starttime,endtime=endtime,channel=‘LGZ’,location=’*’,attach_response=True)
st.remove_response(output=“DISP”)
Traceback (most recent call last):
File “getearthtidedata.py”, line 11, in
st.remove_response(output=“DISP”)
File “/home/kasper/miniconda3/lib/python3.5/site-packages/obspy/core/stream.py”, line 3035, in remove_response
tr.remove_response(*args, **kwargs)
File “”, line 2, in remove_response
File “/home/kasper/miniconda3/lib/python3.5/site-packages/obspy/core/trace.py”, line 232, in _add_processing_info
result = func(*args, **kwargs)
File “/home/kasper/miniconda3/lib/python3.5/site-packages/obspy/core/trace.py”, line 2717, in remove_response
output=output, **kwargs)
File “/home/kasper/miniconda3/lib/python3.5/site-packages/obspy/core/inventory/response.py”, line 1060, in get_evalresp_response
gain_blkt.gain = self.instrument_sensitivity.value
TypeError: a float is required
The channel response’s gains are:
response: Channel Response
From M/S2 (Acceleration in meters) to COUNTS (DIGITAL COUNTS)
Overall Sensitivity: UNKNOWN defined at UNKNOWN Hz
2 stages:
Stage 1: PolesZerosResponseStage from M/S2 to COUNTS, gain: -1.2626e+06
Stage 2: CoefficientsTypeResponseStage from COUNTS to COUNTS, gain: 1e+06]
which are quite different than in the (working) demo:
response: Channel Response
From M/S (velocity in meters per second) to COUNTS (digital counts)
Overall Sensitivity: 6.30907e+08 defined at 0.200 Hz
3 stages:
Stage 1: PolesZerosResponseStage from M/S to V, gain: 1504.2
Stage 2: CoefficientsTypeResponseStage from V to COUNTS, gain: 419430
Stage 3: CoefficientsTypeResponseStage from COUNTS to COUNTS, gain: 1