obspy.clients.seedlink.easyseedlink.EasySeedLinkClient¶
-
class
EasySeedLinkClient
(server_url, autoconnect=True)[source]¶ Bases:
object
An easy-to-use SeedLink client.
This class is meant to be used as a base class, with a subclass implementing one or more of the callbacks (most usefully the
on_data()
callback). See the ObsPy Tutorial for a detailed example.Example
# Subclass the client class class MyClient(EasySeedLinkClient): # Implement the on_data callback def on_data(self, trace): print('Received trace:') print(trace) # Connect to a SeedLink server client = MyClient('geofon.gfz-potsdam.de:18000') # Retrieve INFO:STREAMS streams_xml = client.get_info('STREAMS') print(streams_xml) # Select a stream and start receiving data client.select_stream('BW', 'RJOB', 'EHZ') client.run()
Implementation
The EasySeedLinkClient uses the
SeedLinkConnection
object. (It is not based onSLClient
.)- Parameters
Warning
The SeedLink connection only fails on connection errors if the connection was started explicitly, either when
autoconnect
isTrue
or by callingconnect()
explicitly. Otherwise the client might get stuck in an infinite reconnect loop if there are connection problems (e.g. connect, timeout, reconnect, timeout, …). This might be intended behavior in some situations.Attributes
__dict__
__doc__
__module__
__weakref__
list of weak references to the object (if defined)
capabilities
The server’s capabilities, parsed from
INFO:CAPABILITIES
(cached).Public Methods
Close the SeedLink connection.
Connect to the SeedLink server.
Send a SeedLink
INFO
command and retrieve response.Check if the SeedLink server has a certain capability.
A shortcut for checking for
INFO
capabilities.Callback for handling the reception of waveform data.
Callback for handling SeedLink errors.
Callback for handling connection termination.
Start streaming data from the SeedLink server.
Select a stream for data transfer.
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
Send the CAT command to a server and receive the answer.
Send a command to the server and read the response.
Special Methods
Default dir() implementation.
Default object formatter.
Initialize self.
This method is called when a class is subclassed.
Create and return a new object.
Helper for pickle.
Helper for pickle.
Size of object in memory, in bytes.
Abstract classes can override this to customize issubclass().