gain from inventory

Hi,

I have an inventory object which I have obtained from reading SeisComP3 station inventory XML file:

sc3inv = sc3._read_sc3ml(invFile)

How can I extract the values for channel sensitivity and the instrument gain for every network, station, location, channel?

Regards,
Dirk

Hi Dirk

try something along:

from obspy import read_inventory�� # rather than using _read_sc3ml() which is not intended as a public function
sc3inv = read_inventory(invFile)
for network in sc3inv.networks:
��� for station in network.stations:
��� ��� for channel in station.channels:
��� ��� ��� response = channel.response
��� ��� ��� for stage in response.response_stages:
��� ��� ��� ��� gain = stage.stage_gain
��������������� seedid = '%s.%s.%s.%s' % (network.code,station.code,channel.location_code,channel.code)
��������������� print "%s, stage %s: %f" % (seedid,stage.stage_sequence_number,gain)

For some more insight into the Inventory object returned from read_inventory() I’ve attached a mapping of the class I made a while ago (still some bits and pieces missing though and may contain errors)

regP

ObspyInventory.pdf (88.1 KB)

Thank you. That has helped.

Dirk