instrument response with a (gravity) station of unknown sensitivity

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/S
2 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

Hi Kasper,

seems to me that ObsPy parses the file correctly - you can look at the
file here:
https://service.iris.edu/fdsnws/station/1/query?network=SG&station=ST&channel=LGZ&level=response&starttime=2010-03-11&endtime=2010-03-12

There is no overall sensitivity gain defined in the file so this is not
really a valid StationXML file.

You can "fix" this for example by

r.instrument_sensitivity.value = 1.0

This is of course not correct but the overall sensitivity will be
ignored by evalresp in any case. Maybe ObsPy should be a bit smarter
here? Please open a github issue on this if you feel we should change
that behavior.

On the latest ObsPy master you can also do:

r.instrument_sensitivity.value = 1.0

r.recalculate_overall_sensitivity(frequency=0.01)

print(r)

Channel Response
    From M/S**2 (Acceleration in meters) to COUNTS (DIGITAL COUNTS)
    Overall Sensitivity: 4.90166e+09 defined at 0.010 Hz
    2 stages:
        Stage 1: PolesZerosResponseStage from M/S**2 to COUNTS, gain:
-1.2626e+06
        Stage 2: CoefficientsTypeResponseStage from COUNTS to COUNTS,
gain: 1e+06

Cheers!

Lion

Lion, thank you for the explanation. I agree obspy is doing the right thing in this case. But I am sure that a few months ago, I was able to do an instrument response on the gravimeter this way, without error. Maybe the values were all wrong, but obspy did not throw an error then!

Maybe the gain info provided by the station changed? I don’t know if these large (negative and positive) values mean anything:

Stage 1: PolesZerosResponseStage from M/S**2 to COUNTS, gain: -1.2626e+06
Stage 2: CoefficientsTypeResponseStage from COUNTS to COUNTS, gain: 1e+06

I’ll try to find a gravimeter expert.

Cheers,
kasper

Could be the metadata changed on the server, hard to tell. Ideally you
should try to contact the operators of the instrument and let them know
that there is a problem with the station metadata

http://eost.unistra.fr/observatoires/geodesie-et-gravimetrie/gravimetrie/

cheers,
T