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
      • obspy.clients.seedlink.slclient.SLClient
      • obspy.clients.seedlink.slpacket.SLPacket
      • obspy.clients.seedlink.client.slnetstation.SLNetStation
      • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection
        • SeedLinkConnection
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.DFT_READBUF_SIZE
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.QUOTE_CHAR
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.SEEDLINK_DEFAULT_PORT
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.SEEDLINK_PROTOCOL_PREFIX
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.UNINETWORK
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.UNISTATION
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.add_stream
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.check_slcd
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.check_version
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.close
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.collect
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.config_link
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.connect
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.disconnect
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.do_terminate
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_info_string
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_keep_alive
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_net_delay
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_net_timeout
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_sl_address
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_state
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.get_streams
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.is_connected
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.is_connected_impl
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.negotiate_multi_station
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.negotiate_station
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.negotiate_uni_station
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.parse_stream_list
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.read_stream_list
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.receive_data
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.recover_state
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.request_info
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.save_state
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.say_hello
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.send_data
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.send_info_request
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_begin_time
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_end_time
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_keep_alive
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_last_pkt_time
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_net_delay
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_net_timeout
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_sl_address
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_state_file
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.set_uni_params
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.terminate
        • obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection.update_stream
      • 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.client.seedlinkconnection.SeedLinkConnection
  • View page source

obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection

class SeedLinkConnection(timeout=None)[source]

Bases: object

Class to manage a connection to a SeedLink server using a Socket.

See obspy.realtime.seedlink.SLClient for an example of how to create and use this SeedLinkConnection object. A new SeedLink application can be created by sub-classing SLClient, or by creating a new class and invoking the methods of SeedLinkConnection.

Variables:
  • SEEDLINK_PROTOCOL_PREFIX – URI/URL prefix for seedlink servers (“seedlink://”).

  • UNISTATION – The station code used for uni-station mode.

  • UNINETWORK – The network code used for uni-station mode.

  • DFT_READBUF_SIZE – Default size for buffer to hold responses from server (default is 1024).

  • QUOTE_CHAR – Character used for delimiting timestamp strings in the statefile.

Publicly accessible (get/set) parameters:

Variables:
  • sladdr – The host:port of the SeedLink server.

  • keepalive – Interval to send keepalive/heartbeat (seconds) (default is 0 sec).

  • netto – Network timeout (seconds) (default is 120 sec).

  • netdly – Network reconnect delay (seconds) (default is 30 sec).

  • info_string – String containing concatenation of contents of last terminated set of INFO packets.

  • statefile – File name for storing state information.

  • lastpkttime – Flag to control last packet time usage, if true, begin_time is appended to DATA command (Default is False).

Parameters:

timeout (float) – Time in seconds after which a collect() call will be interrupted.

Protected parameters

Variables:
  • streams – Vector of SLNetStation objects.

  • begin_time – Beginning of time window.

  • end_time – End of time window.

  • resume – Flag to control resuming with sequence numbers.

  • multistation – Flag to indicate multistation mode.

  • dialup – Flag to indicate dial-up mode.

  • terminate_flag – Flag to control connection termination.

  • server_id – ID of the remote SeedLink server.

  • server_version – Version of the remote SeedLink server.

  • info_request_string – INFO level to request.

  • socket – The network socket.

  • state – Persistent state information.

  • infoStrBuf – String to store INFO packet contents.

Attributes

DFT_READBUF_SIZE

QUOTE_CHAR

SEEDLINK_DEFAULT_PORT

SEEDLINK_PROTOCOL_PREFIX

UNINETWORK

UNISTATION

Public Methods

add_stream

Add a new stream entry to the stream chain for the given net/station parameters.

check_slcd

Check this SeedLinkConnection description has valid parameters.

check_version

Checks server version number against a given specified value.

close

Closes this SeedLinkConnection by closing the network socket and saving the state to the statefile, if it exists.

collect

Manage a connection to a SeedLink server based on the values given in this SeedLinkConnection, and to collect data.

config_link

Configure/negotiate data stream(s) with the remote SeedLink server.

connect

Open a network socket connection to a SeedLink server.

disconnect

Close the network socket associated with this connection.

do_terminate

Terminate the collection loop.

get_info_string

Returns the results of the last INFO request.

get_keep_alive

Returns the interval to send keepalive/heartbeat (seconds).

get_net_delay

Returns the network reconnect delay (seconds).

get_net_timeout

Returns the network timeout (seconds).

get_sl_address

Returns the host:port of the SeedLink server.

get_state

Returns the SLState state object.

get_streams

Returns a copy of the Vector of SLNetStation objects.

is_connected

Returns connection state of the connection socket.

is_connected_impl

Check a socket for write ability using select()

negotiate_multi_station

Negotiate a SeedLink connection using multi-station mode and issue the END action command.

negotiate_station

Negotiate a SeedLink connection for a single station and issue the DATA command.

negotiate_uni_station

Negotiate a SeedLink connection in uni-station mode and issue the DATA command.

parse_stream_list

Parse a string of streams and selectors and add them to the stream chain for configuring a multi-station connection.

read_stream_list

Read a list of streams and selectors from a file and add them to the stream chain for configuring a multi-station connection.

receive_data

Read bytes from the server.

recover_state

Recover the state file and put the sequence numbers and time stamps into the pre-existing stream chain entries.

request_info

Add an INFO request to the SeedLink Connection Description.

save_state

Save all current sequence numbers and time stamps into the given state file.

say_hello

Send the HELLO command and attempt to parse the server version number from the returned string.

send_data

Send bytes to the server.

send_info_request

Sends a request for the specified INFO level.

set_begin_time

Sets begin_time for initiation of continuous data transmission.

set_end_time

Sets end_time for termination of data transmission.

set_keep_alive

Sets interval to send keepalive/heartbeat (seconds).

set_last_pkt_time

Sets a specified start time for beginning of data transmission .

set_net_delay

Sets the network reconnect delay (seconds).

set_net_timeout

Sets the network timeout (seconds).

set_sl_address

Sets the host:port of the SeedLink server.

set_state_file

Set the state file and recover state.

set_uni_params

Set the parameters for a uni-station mode connection for the given SLCD struct.

terminate

Sets terminate flag, closes connection and clears state.

update_stream

Update the appropriate stream chain entry given a Mini-SEED record.

Special Methods

SeedLinkConnection.__delattr__(name, /)

Implement delattr(self, name).

SeedLinkConnection.__dir__()

Default dir() implementation.

SeedLinkConnection.__eq__(value, /)

Return self==value.

SeedLinkConnection.__format__(format_spec, /)

Default object formatter.

SeedLinkConnection.__ge__(value, /)

Return self>=value.

SeedLinkConnection.__getattribute__(name, /)

Return getattr(self, name).

SeedLinkConnection.__gt__(value, /)

Return self>value.

SeedLinkConnection.__hash__()

Return hash(self).

SeedLinkConnection.__init__(timeout=None)[source]

Creates a new instance of SeedLinkConnection.

SeedLinkConnection.__init_subclass__()

This method is called when a class is subclassed.

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

SeedLinkConnection.__le__(value, /)

Return self<=value.

SeedLinkConnection.__lt__(value, /)

Return self<value.

SeedLinkConnection.__ne__(value, /)

Return self!=value.

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

Helper for pickle.

SeedLinkConnection.__reduce_ex__(protocol, /)

Helper for pickle.

SeedLinkConnection.__repr__()

Return repr(self).

SeedLinkConnection.__setattr__(name, value, /)

Implement setattr(self, name, value).

SeedLinkConnection.__sizeof__()

Size of object in memory, in bytes.

SeedLinkConnection.__str__()

Return str(self).

SeedLinkConnection.__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.