obspy.clients.seedlink.easyseedlink
A simplified interface to the obspy.clients.seedlink module.
The EasySeedLinkClient
class contained in this module provides a
more pythonic interface to the obspy.clients.seedlink
module with a
focus on ease of use, while minimizing unnecessary exposure of the protocol
specifics.
A client object can easily be created using the create_client()
function, e.g. by providing a function to handle incoming data and a server
URL:
from obspy.clients.seedlink.easyseedlink import create_client
# A function to handle incoming data
def handle_data(trace):
print('Received the following trace:')
print(trace)
print()
# Create the client and pass the function as a callback
client = create_client('geofon.gfz-potsdam.de', on_data=handle_data)
client.select_stream('BW', 'MANZ', 'EHZ')
client.run()
For advanced applications, subclassing the EasySeedLinkClient
class
allows for more flexibility. See the EasySeedLinkClient
documentation for an example.
Note
For finer grained control of the SeedLink connection (e.g. custom
processing of individual SeedLink packets), using
SeedLinkConnection
or SLClient
directly might be the
preferred option.
Limitations
As of now, single station mode is not supported. Neither are in-stream INFO
requests.
The client is using the
SeedLinkConnection
class and hence inherits all of its limitations. For example, erroneous packets
are only logged, but otherwise ignored, with no possibility of handling them
explicitly. Keepalive handling is completely encapsulated inside the
connection object and cannot be easily influenced. Also, a HELLO
is always
sent to the server when connecting in order to determine the SeedLink protocol
version.
Public Functions
Quickly create an EasySeedLinkClient instance. |
Classes
An easy-to-use SeedLink client. |
Exceptions
A base exception for all errors triggered explicitly by EasySeedLinkClient. |