本文整理匯總了Python中obspy.iris.Client.availability方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.availability方法的具體用法?Python Client.availability怎麽用?Python Client.availability使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類obspy.iris.Client
的用法示例。
在下文中一共展示了Client.availability方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_issue419
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import availability [as 別名]
def test_issue419(self):
"""
obspy.iris.Client.availability should work with output='bulkdataselect'
"""
client = Client()
# 1 - default output ('bulkdataselect')
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = UTCDateTime("2010-02-27T10:30:00.000")
result = client.availability('IU', channel='B*', starttime=t1,
endtime=t2)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU YSS 00 BHZ' in result)
# 2 - explicit set output 'bulkdataselect'
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = UTCDateTime("2010-02-27T10:30:00.000")
result = client.availability('IU', channel='B*', starttime=t1,
endtime=t2, output='bulkdataselect')
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU YSS 00 BHZ' in result)
# 3 - output 'bulk' (backward compatibility)
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = UTCDateTime("2010-02-27T10:30:00.000")
with warnings.catch_warnings(record=True):
warnings.simplefilter('ignore', DeprecationWarning)
result = client.availability('IU', channel='B*', starttime=t1,
endtime=t2, output='bulk')
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU YSS 00 BHZ' in result)
# 4 - output 'xml'
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = UTCDateTime("2010-02-27T10:30:00.000")
result = client.availability('IU', channel='B*', starttime=t1,
endtime=t2, output='xml')
self.assertTrue(isinstance(result, basestring))
self.assertTrue('<?xml' in result)
示例2: test_availability
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import availability [as 別名]
def test_availability(self):
"""
Tests availability of waveform data at the DMC.
Examples are inspired by http://www.iris.edu/ws/availability/.
"""
client = Client()
# 1
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = UTCDateTime("2010-02-27T10:30:00.000")
result = client.availability('IU', channel='B*', starttime=t1,
endtime=t2)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU YSS 00 BHZ' in result)
# 2
dt = UTCDateTime("2011-11-13T07:00:00")
result = client.availability(network='GE', starttime=dt,
endtime=dt + 10)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('GE DAG -- BHE' in result)
# 3 - unknown network results in empty string
dt = UTCDateTime(2011, 11, 16)
result = client.availability(network='XX', starttime=dt,
endtime=dt + 10)
# 4 - location=None
t1 = UTCDateTime("2010-02-27T06:30:00")
t2 = UTCDateTime("2010-02-27T06:40:00")
result = client.availability("IU", "K*", starttime=t1, endtime=t2)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU KBL -- BHZ' in result)
self.assertTrue('IU KBS 00 BHE' in result)
# 5 - empty location
result = client.availability("IU", "K*", "", starttime=t1, endtime=t2)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU KBL -- BHZ' in result)
self.assertFalse('IU KBS 00 BHE' in result)
# 6 - empty location code via '--'
result = client.availability("IU", "K*", "--", starttime=t1,
endtime=t2)
self.assertTrue(isinstance(result, basestring))
self.assertTrue('IU KBL -- BHZ' in result)
self.assertFalse('IU KBS 00 BHE' in result)
示例3: print
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import availability [as 別名]
print (st[0].stats)
st.write('REF.EHZ.2009:082.mseed', format='MSEED')
#st.write('REF.EHZ.2009:082.wave', format='WAV', framerate=6000)
st.write('REF.EHZ.2009:082.sac', format='SAC')
# This needs basemap and demonstrates the event and catalog classes
from obspy.core.event import *
cat = readEvents(\
"http://www.seismicportal.eu/services/event/search?magMin=8.0")
cat.plot()
# IRIS DMC example
from obspy.iris import Client
from obspy.core import UTCDateTime
client = Client()
t = UTCDateTime("2012-08-05T06:00:00.000")
st = client.getWaveform('IU', 'ANMO', '00', 'BHZ', t, t + 300)
st.plot()
# Earthworm wave server example - connection is refused though
from obspy.earthworm import Client
client = Client("pele.ess.washington.edu", 16017)
response = client.availability("UW", "TUCA", channel="BHZ")
print response
t = response[0][4]
st = client.getWaveform('UW', 'TUCA', '', 'BH*', t + 100, t + 130)
st.plot()
示例4: raw_input
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import availability [as 別名]
t2=UTCDateTime(2012,5,21)
file_name = raw_input('Enter the name of the stream file!\n')
print t1
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]
示例5: wavesdownloader
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import availability [as 別名]
#.........這裏部分代碼省略.........
if args.mode == "circular":
(downloadPath,ID) = user.run_circular_query( \
args.net,args.sta,args.cha, \
center[0],center[1],kmradius[0],kmradius[1], \
args.beg,args.end,aFORMAT)
else: # i.e.: rectangular
(downloadPath,ID) = user.run_rectangular_query( \
args.net,args.sta,args.cha, \
bbox[0],bbox[1],bbox[2],bbox[3], \
args.beg,args.end,aFORMAT)
#set name and location of the fseed
archiveFile = downloadPath + os.sep + ID + "_data.tgz"
(root,seed)=grabIngvEidaArchive(archiveFile,aFormat)
# get stream
try:
dataStreamEida = read(seed)
except:
print "no data found or no response from Eida server"
# if iris is on
if args.server[1] == 1:
# Convert some args for eida syntax
args.net=reformatNetStaList(args.net,"iris")
args.sta=reformatNetStaList(args.sta,"iris")
args.cha=reformatNetStaList(args.cha,"iris")
# initialize downloader
print "\n \nDownloading from iris"
if args.mode == "circular":
response = irisClient.availability( \
network=args.net, station=args.sta, channel=args.cha, \
location=args.loc,starttime=t1, endtime=t2, \
lat=center[0], lon=center[1], minradius=grradius[0], maxradius=grradius[1])
else: # i.e.: rectangular
IrisBox = setIrisRectBox(bbox)
response = irisClient.availability( \
network=args.net, station=args.sta, channel=args.cha, \
location=args.loc,starttime=t1, endtime=t2,\
minlat=IrisBox[0], minlon=IrisBox[1], maxlat=IrisBox[2], maxlon=IrisBox[3])
# Download
try:
dataStreamIris = irisClient.bulkdataselect(response)
# here save mseed file format
dataStreamIris.write(args.outdir + os.sep + 'iris.' + ID + '_data.mseed',format='MSEED', encoding='STEIM2')
except:
print "IRIS bulkdataselect returns False. No data from IRIS\n\n"
#
# if local is on
if args.server[2] == 1:
print "\n \nExtracting from local fseed"
dataStreamLoca=read(args.fsfile)
# if ARClink - WEBDC is on
if args.server[3] == 1:
print "\n \nDownloading from WEBDC via ArcLink"
# Convert some args for eida syntax