# instrument response with a (gravity) station of	unknown sensitivity

**URL:** <https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [August 11, 2017, 3:12am UTC](https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684 "2017-08-11T03:12:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kasper\_van\_Wijk](https://discourse.obspy.org/user_avatar/discourse.obspy.org/kasper_van_wijk/32/404_2.png) [@Kasper\_van\_Wijk](https://discourse.obspy.org/u/Kasper_van_Wijk)\
**Post date:** [August 11, 2017, 3:12am UTC](https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684/1 "2017-08-11T03:12:51Z")

</div>

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/S**2 (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:](https://docs.obspy.org/packages/autogen/obspy.clients.fdsn.client.Client.get_waveforms.html#obspy.clients.fdsn.client.Client.get_waveforms)  
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

---

<div class="post-metadata">

**Author:** ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)\
**Post date:** [August 11, 2017, 9:38am UTC](https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684/2 "2017-08-11T09:38:56Z")

</div>

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](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  
&nbsp;&nbsp;&nbsp;&nbsp;From M/S\*\*2 (Acceleration in meters) to COUNTS (DIGITAL COUNTS)  
&nbsp;&nbsp;&nbsp;&nbsp;Overall Sensitivity: 4.90166e+09 defined at 0.010 Hz  
&nbsp;&nbsp;&nbsp;&nbsp;2 stages:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stage 1: PolesZerosResponseStage from M/S\*\*2 to COUNTS, gain:  
-1.2626e+06  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stage 2: CoefficientsTypeResponseStage from COUNTS to COUNTS,  
gain: 1e+06

Cheers!

Lion

---

<div class="post-metadata">

**Author:** ![Kasper\_van\_Wijk](https://discourse.obspy.org/user_avatar/discourse.obspy.org/kasper_van_wijk/32/404_2.png) [@Kasper\_van\_Wijk](https://discourse.obspy.org/u/Kasper_van_Wijk)\
**Post date:** [August 12, 2017, 5:22am UTC](https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684/3 "2017-08-12T05:22:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [August 12, 2017, 12:45pm UTC](https://discourse.obspy.org/t/instrument-response-with-a-gravity-station-of-unknown-sensitivity/684/4 "2017-08-12T12:45:00Z")

</div>

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/](http://eost.unistra.fr/observatoires/geodesie-et-gravimetrie/gravimetrie/)

cheers,  
T
