本文整理汇总了Python中obspy.clients.arclink.Client.getInventory方法的典型用法代码示例。如果您正苦于以下问题:Python Client.getInventory方法的具体用法?Python Client.getInventory怎么用?Python Client.getInventory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.clients.arclink.Client
的用法示例。
在下文中一共展示了Client.getInventory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ARC_available
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import getInventory [as 别名]
def ARC_available(input_dics, event, target_path, event_number):
"""
Check the availability of ArcLink stations
"""
print "Check the availability of ArcLink stations"
client_arclink = Client_arclink(user='[email protected]',
timeout=input_dics['arc_avai_timeout'])
Sta_arc = []
try:
inventories = client_arclink.getInventory(
network=input_dics['net'],
station=input_dics['sta'],
location=input_dics['loc'],
channel=input_dics['cha'],
starttime=UTCDateTime(event['t1']),
endtime=UTCDateTime(event['t2']),
min_latitude=input_dics['mlat_rbb'],
max_latitude=input_dics['Mlat_rbb'],
min_longitude=input_dics['mlon_rbb'],
max_longitude=input_dics['Mlon_rbb'])
for inv_key in inventories.keys():
netsta = inv_key.split('.')
if len(netsta) == 4:
sta = '%s.%s' % (netsta[0], netsta[1])
if not inventories[sta]['depth']:
inventories[sta]['depth'] = 0.0
Sta_arc.append([netsta[0], netsta[1], netsta[2], netsta[3],
inventories[sta]['latitude'],
inventories[sta]['longitude'],
inventories[sta]['elevation'],
inventories[sta]['depth']])
except Exception as e:
exc_file = open(os.path.join(target_path, 'info', 'exception'), 'a+')
ee = 'arclink -- Event: %s --- %s\n' % (str(event_number+1), e)
exc_file.writelines(ee)
exc_file.close()
print 'ERROR: %s' % ee
if len(Sta_arc) == 0:
Sta_arc.append([])
Sta_arc.sort()
return Sta_arc