ObsPy Logo
1.4.0

Getting Started

  • Tutorial
  • Gallery
  • API Overview
    • obspy.core - Core classes of ObsPy
    • Classes & Functions
    • Modules
    • obspy.geodetics - Various geodetic utilities for ObsPy
    • Classes & Functions
    • Modules
    • obspy.imaging - Plotting routines for ObsPy
    • Classes & Functions
    • Modules
    • Scripts
    • obspy.realtime - Real time support for ObsPy
    • Modules
    • obspy.signal - Signal processing routines for ObsPy
    • Classes & Functions
    • Modules
    • obspy.taup - Ray theoretical travel times and paths
    • Classes & Functions
    • Modules
    • obspy.scripts.flinnengdahl
    • obspy.scripts.runtests
    • obspy.scripts.reftekrescue
    • obspy.scripts.print
    • obspy.scripts.sds_html_report
    • obspy.imaging.scripts.scan
    • obspy.imaging.scripts.plot
    • obspy.imaging.scripts.mopad
    • obspy.io.mseed.scripts.recordanalyzer
    • obspy.io.xseed.scripts.dataless2xseed
    • obspy.io.xseed.scripts.xseed2dataless
    • obspy.io.xseed.scripts.dataless2resp
    • obspy.clients.earthworm - Earthworm Wave Server client for ObsPy.
    • Classes & Functions
    • Modules
    • obspy.clients.fdsn - FDSN web service client for ObsPy
    • Classes & Functions
    • Modules
    • obspy.clients.filesystem - Local filesystem (SDS or TSINDEX) client for ObsPy
    • Classes & Functions
    • Modules
    • obspy.clients.iris - IRIS web service client for ObsPy
    • Classes & Functions
    • Modules
    • obspy.clients.neic - CWB query module for ObsPy
    • Classes & Functions
    • Modules
    • obspy.clients.nrl - Nominal Response Library client for ObsPy
    • Classes & Functions
    • Modules
    • Scripts
    • obspy.clients.seedlink - SeedLink client for ObsPy
    • Classes & Functions
      • obspy.clients.seedlink.basic_client.Client
      • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient
        • EasySeedLinkClient
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.capabilities
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.close
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.connect
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.get_info
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.has_capability
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.has_info_capability
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.on_data
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.on_seedlink_error
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.on_terminate
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.run
        • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient.select_stream
      • obspy.clients.seedlink.slclient.SLClient
      • obspy.clients.seedlink.slpacket.SLPacket
      • obspy.clients.seedlink.client.slnetstation.SLNetStation
      • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection
      • obspy.clients.seedlink.client.slstate.SLState
    • Modules
    • obspy.clients.syngine - IRIS Syngine client for ObsPy
    • Classes & Functions
    • Modules
    • obspy.io.ah - AH (Ad Hoc) read support for ObsPy
    • Modules
    • obspy.io.alsep - Apollo seismic data support for ObsPy
    • Modules
    • obspy.io.ascii - SLIST and TSPAIR support for ObsPy
    • Modules
    • obspy.io.css - CSS read support for ObsPy
    • Modules
    • obspy.io.dmc - INGV DMX file format reader for ObsPy
    • Modules
    • obspy.io.gcf - Guralp Compressed Format, GCF, read and write support for ObsPy
    • Modules
    • obspy.io.gse2 - GSE2/GSE1 and GSE2 bulletin support for ObsPy
    • Modules
    • obspy.io.kinemetrics - Evt format support for ObsPy
    • Modules
    • obspy.io.mseed - MiniSEED read and write support for ObsPy
    • Modules
    • Scripts
    • obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy
    • obspy.io.pdas - PDAS file read support for ObsPy
    • Modules
    • obspy.io.reftek - REFTEK130 read support for ObsPy
    • Modules
    • obspy.io.rg16 - Receiver Gather v1.6 read support for ObsPy
    • Modules
    • obspy.io.sac - SAC read and write support for ObsPy
    • Modules
    • obspy.io.seisan - SEISAN read support for ObsPy
    • Modules
    • obspy.io.seg2 - SEG-2 read support for ObsPy
    • Modules
    • obspy.io.segy - SEG Y and SU read and write support for ObsPy
    • Classes & Functions
    • Modules
    • obspy.io.sh - Q and ASC read and write, EVT read support (Seismic Handler)
    • Modules
    • obspy.io.wav - WAV (audio) read and write support for ObsPy
    • Modules
    • obspy.io.win - WIN read support for ObsPy
    • Modules
    • obspy.io.y - Nanometrics Y file read support for ObsPy
    • Modules
    • obspy.io.cmtsolution - CMTSOLUTION file format support for ObsPy
    • Modules
    • obspy.io.cnv - CNV file format support for ObsPy
    • Modules
    • obspy.io.focmec - FOCMEC file format support for ObsPy
    • Modules
    • obspy.io.gse2 - GSE2/GSE1 and GSE2 bulletin support for ObsPy
    • Modules
    • obspy.io.hypodd - HypoDD read support for ObsPy
    • Modules
    • obspy.io.iaspei - Read support for IASPEI formats
    • Modules
    • obspy.io.json - JSON write support for ObsPy
    • Classes & Functions
    • Modules
    • obspy.io.kml - Keyhole Markup Language (KML) write support for ObsPy
    • Modules
    • obspy.io.ndk - NDK file support for ObsPy
    • Modules
    • obspy.io.nied.fnet - F-net moment tensor file read support for ObsPy
    • obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy
    • obspy.io.nlloc - NonLinLoc file format support for ObsPy
    • Modules
    • obspy.io.nordic - Nordic file format support for ObsPy
    • Modules
    • obspy.io.pde - NEIC PDE Bulletin read support for ObsPy
    • Modules
    • obspy.io.quakeml - QuakeML read and write support for ObsPy
    • obspy.io.quakeml.core._is_quakeml
    • obspy.io.quakeml.core._read_quakeml
    • obspy.io.quakeml.core._read_seishub_event_xml
    • obspy.io.quakeml.core._write_quakeml
    • obspy.io.quakeml.core.Pickler
    • obspy.io.quakeml.core.Unpickler
    • obspy.io.scardec - SCARDEC file format support for ObsPy
    • Modules
    • obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy
    • Modules
    • obspy.io.shapefile - ESRI shapefile write support for ObsPy
    • Modules
    • obspy.io.zmap - ZMAP read and write support for ObsPy
    • Modules
    • obspy.io.css - CSS read support for ObsPy
    • Modules
    • obspy.io.kml - Keyhole Markup Language (KML) write support for ObsPy
    • Modules
    • obspy.io.sac.sacpz - SACPZ write support for ObsPy
    • obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy
    • Modules
    • obspy.io.shapefile - ESRI shapefile write support for ObsPy
    • Modules
    • obspy.io.stationtxt - FDSNWS station text file read and write support for ObsPy
    • Modules
    • obspy.io.stationxml - StationXML read and write support for ObsPy
    • Modules
    • obspy.io.xseed - (X)SEED and RESP support for ObsPy
    • Classes & Functions
    • Modules
    • Scripts

Developer Resources

  • Contributing to ObsPy
  • Coding Style Guide
  • Contributor Covenant Code of Conduct
  • Changelog

Indices and Tables

  • Table of Contents
  • Citations
  • Contributors
ObsPy
  • API Overview
  • obspy.clients.seedlink - SeedLink client for ObsPy
  • obspy.clients.seedlink.easyseedlink.EasySeedLinkClient
  • View page source

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 on SLClient.)

Parameters:
  • server_url (str) – The SeedLink server URL

  • autoconnect (bool) – Connect to the server when the client object is created; default is True.

Warning

The SeedLink connection only fails on connection errors if the connection was started explicitly, either when autoconnect is True or by calling connect() 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

capabilities

The server's capabilities, parsed from INFO:CAPABILITIES (cached).

Public Methods

close

Close the SeedLink connection.

connect

Connect to the SeedLink server.

get_info

Send a SeedLink INFO command and retrieve response.

has_capability

Check if the SeedLink server has a certain capability.

has_info_capability

A shortcut for checking for INFO capabilities.

on_data

Callback for handling the reception of waveform data.

on_seedlink_error

Callback for handling SeedLink errors.

on_terminate

Callback for handling connection termination.

run

Start streaming data from the SeedLink server.

select_stream

Select a stream for data transfer.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

EasySeedLinkClient._get_cat()[source]

Send the CAT command to a server and receive the answer.

This can potentially be used for older SeedLink servers that don’t support the INFO:STREAMS command yet.

EasySeedLinkClient._send_and_recv(bytes_, stop_on=[b'END'])[source]

Send a command to the server and read the response.

The response is read until a packet is received that ends with one of the provided stop words.

Warning

If the server doesn’t send one of the stop words, this never returns!

Parameters:
  • bytes (bytes) – The bytes to send to the server

  • stop_on (list[str]) – A list of strings that indicate the end of the server response.

Return type:

bytes

Returns:

The server’s response

Special Methods

EasySeedLinkClient.__delattr__(name, /)

Implement delattr(self, name).

EasySeedLinkClient.__dir__()

Default dir() implementation.

EasySeedLinkClient.__eq__(value, /)

Return self==value.

EasySeedLinkClient.__format__(format_spec, /)

Default object formatter.

EasySeedLinkClient.__ge__(value, /)

Return self>=value.

EasySeedLinkClient.__getattribute__(name, /)

Return getattr(self, name).

EasySeedLinkClient.__gt__(value, /)

Return self>value.

EasySeedLinkClient.__hash__()

Return hash(self).

EasySeedLinkClient.__init__(server_url, autoconnect=True)[source]
EasySeedLinkClient.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

EasySeedLinkClient.__le__(value, /)

Return self<=value.

EasySeedLinkClient.__lt__(value, /)

Return self<value.

EasySeedLinkClient.__ne__(value, /)

Return self!=value.

EasySeedLinkClient.__new__(**kwargs)
EasySeedLinkClient.__reduce__()

Helper for pickle.

EasySeedLinkClient.__reduce_ex__(protocol, /)

Helper for pickle.

EasySeedLinkClient.__repr__()

Return repr(self).

EasySeedLinkClient.__setattr__(name, value, /)

Implement setattr(self, name, value).

EasySeedLinkClient.__sizeof__()

Size of object in memory, in bytes.

EasySeedLinkClient.__str__()

Return str(self).

EasySeedLinkClient.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

Next Previous

© Copyright 2012-2022, The ObsPy Development Team (devs@obspy.org). Last updated on 2022-11-21T14:30:24.

Built with Sphinx 5.3.0 using a theme provided by Read the Docs.