本文整理汇总了Python中obspy.clients.arclink.Client.save_response方法的典型用法代码示例。如果您正苦于以下问题:Python Client.save_response方法的具体用法?Python Client.save_response怎么用?Python Client.save_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.clients.arclink.Client
的用法示例。
在下文中一共展示了Client.save_response方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_response
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import save_response [as 别名]
def test_save_response(self):
"""
Fetches and stores response information as Dataless SEED volume.
"""
client = Client(user='[email protected]')
start = UTCDateTime(2008, 1, 1)
end = start + 1
with NamedTemporaryFile() as tf:
tempfile = tf.name
# Dataless SEED
client.save_response(tempfile, 'BW', 'MANZ', '', 'EHZ', start, end)
with open(tempfile, 'rb') as fp:
self.assertEqual(fp.read(8), b"000001V ")
# Try again but write to a BytesIO instance.
file_object = io.BytesIO()
client = Client(user='[email protected]')
start = UTCDateTime(2008, 1, 1)
end = start + 1
# Dataless SEED
client.save_response(file_object, 'BW', 'MANZ', '', 'EHZ', start, end)
file_object.seek(0, 0)
self.assertEqual(file_object.read(8), b"000001V ")