本文整理匯總了Python中obspy.iris.Client.timeseries方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.timeseries方法的具體用法?Python Client.timeseries怎麽用?Python Client.timeseries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類obspy.iris.Client
的用法示例。
在下文中一共展示了Client.timeseries方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_timeseries
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import timeseries [as 別名]
def test_timeseries(self):
"""
Tests timeseries Web service interface.
Examples are inspired by http://www.iris.edu/ws/timeseries/.
"""
client = Client()
# 1
t1 = UTCDateTime("2005-001T00:00:00")
t2 = UTCDateTime("2005-001T00:01:00")
# no filter
st1 = client.timeseries("IU", "ANMO", "00", "BHZ", t1, t2)
# instrument corrected
st2 = client.timeseries("IU", "ANMO", "00", "BHZ", t1, t2, filter=["correct"])
# compare results
self.assertEquals(st1[0].stats.starttime, st2[0].stats.starttime)
self.assertEquals(st1[0].stats.endtime, st2[0].stats.endtime)
self.assertEquals(st1[0].data[0], 24)
self.assertAlmostEquals(st2[0].data[0], -2.4910707e-06)
示例2: range
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import timeseries [as 別名]
print t2
########
#st = client.saveWaveform("./G.SSB.00.BHE", "G", "SSB", "*", "BHE", t1, t2)
#st = client.getWaveform("G", "SSB", "10", "*", t1, t2)
#### Permete d avoir toutes les donnes meeme s il y a des trous
#st = client.timeseries("GB", "CWF", "", "BHZ", t1, t2, output = 'miniseed')
#### timesseries used by obspy give the same result when output is mseed or sacbl
### BUT tiemseries ftrhough webservice from iris directly give a diffetent result when the output is sac or mseed
#### only output mseed is correct
avail = client.availability("GB", "CWF", "", "BHZ", t1, t2,output='xml')
metadata=XML_list_avail(avail)
# 1eme indice = station
print lat,lon
print avail
st = client.timeseries("GB", "CWF", "", "BHZ", t1, t2, output = 'sacbl')
############ NE PAS UTILISER getWavform CAR
##### give only one file the longest one in case of gaps
## st = client.getWaveform("GB", "CWF", "", "BHZ", t1, t2)
print st
st.write(file_name, format = 'SAC')
st=read(file_name+'*')
for i in range(0,len(st)):
lat=metadata[i][4]
lon=metadata[i][5]
tr.stats.sac.stla=lat
tr.stats.sac.stlo=lon
st.write(file_name, format = 'SAC')