[obspy-users] get the information from Inventory

pattylin pattylin at ldeo.columbia.edu
Mon May 12 09:17:50 CEST 2014


Hi All,

I wanna output station information to a file.
however, I stuck in a situation that I am not familiar with getting info 
from inventory.

I figured out how to get one by one.. however, I don't know how to get 
station numbers from inventory.

does any one an idea?

thanks!!

Patty

from obspy.fdsn import Client
from obspy import UTCDateTime

client = Client()
t1 = UTCDateTime("2010-01-12:T00:00:00.000")
t2 = UTCDateTime("2010-01-12:T23:59.59.000")


inv = client.get_stations(starttime=t1 , endtime=t2 , network="TA",
                           station="*", location="*", channel="BHZ",
                           level="response")
net = inv[0]
net
sta = net[0]
print(sta.code)
print(sta.latitude)
print(sta.longitude)




~

-- 
********************************************
Peiying Patty Lin
Postdoctoral Research Scientist
Lamont Doherty Earth Observatory
http://www.ldeo.columbia.edu/~pattylin/
********************************************



More information about the obspy-users mailing list