Guides

This package provides a wrapper of ArcLink client (via arclink_fetch) and SeedLink client (via slinktool) with minimal functional capabilities. Prior to using the clients, you have to install SeisComP3 package and add SeisComP3 binaries and Python libaries to PATH and PYTHONPATH.

  1. Edit your ~/.bashrc and add the following:
export PATH=$PATH:/path/to/seiscomp3/bin:/path/to/seiscomp3/sbin
export PYTHONPATH=$PYTHONPATH:/path/to/seiscomp3/lib:/path/to/seiscomp3/lib/python:/path/to/seiscomp3/lib/python/seiscomp3
  1. Update user system environment variables:
source ~/.bashrc

Stream Manager

Stream manager allows you to make a one way request using Python context manager. It yields a stream file path if request succeed, and remove request file and stream file on exit. For example:

from obspy import read
from richter import stream_manager

with stream_manager(address='192.168.0.25:18001',
                    starttime='2019-01-01 00:00:00',
                    endtime='2019-01-01 01:00:00',
                    network='VG',
                    station='MEPAS',
                    channel='HHZ') as stream_file:
    stream = read(stream_file)
    # Then, do something with stream.

Request to the server is default to using ArcLink client.

Richter Magnitude Scales

This package provides some utilities computing Richter local magnitude scales on BPPTKG seismic network (VG). Currently supported stations are MEDEL (Deles), MELAB (Labuhan), MEPAS (Pasarbubar), and MEPUS (Pusunglondon). For current version, it only support Z component.

You may want to install ObsPy package, because this package only work on ObsPy stream type. Default network is VG and default component is Z:

from obspy import read
import richter

# Read single station or multiple stations streams
stream = read('/path/to/stream.mseed')

# Compute Richter local magnitude for station MEPAS
ml = richter.compute_ml(stream, 'MEPAS', network='VG', component='Z')

# Compute Wood-Anderson zero-to-peak amplitude in meter for station MEPAS
wa_ampl = richter.compute_wa(stream, 'MEPAS', network='VG', component='Z')

# Compute count amplitude peak-to-peak for station MEPAS
app = richter.compute_app(stream, 'MEPAS', network='VG', component='Z')

or for short:

from obspy import read
import richter

stream = read('/path/to/stream.mseed')

ml = richter.compute_ml(stream, 'MEPAS')
wa_ampl = richter.compute_wa(stream, 'MEPAS')
app = richter.compute_app(stream, 'MEPAS')

For current version, on computing local magnitude (compute_ml) and Wood-Anderson amplitude(compute_wa), supported component is only Z component.

compute_app support other components, for example:

app = richter.compute_app(stream, 'MELAB', component='E')