References

richter.ml

Utility module for computing Richter magnitude scales, i.e. ML or local magnitude on BPPTKG seismic network.

richter.ml.compute_analog_ml(p2p_amplitude)

Compute Richter magnitude scales from seismic analog peak-to-peak amplitude.

The peak-to-peak value must be obtained from DEL (Deles) analog station and in mm unit.

Parameters:p2p_amplitude (float) – Peak-to-peak amplitude in mm unit.
Returns:BPPTKG Richter magnitude scale.
Return type:float

Example:

from richter import compute_analog_ml

p2p_amplitude = 50
ml = compute_analog_ml(p2p_amplitude)
print(ml)
richter.ml.compute_app(stream, station, network='VG', component='Z', **kwargs)

Compute stream amplitude peak to peak.

Parameters:
  • stream (obspy.core.stream.Stream) – ObsPy waveform stream object.
  • station (str) – Seismic station name, e.g. MEPAS, MEGRA, etc.
  • network (str) – Seismic network name, default to VG.
  • component (str) – Seismic station component, e.g E, N, Z, default to Z.
Returns:

Stream amplitude peak to peak.

Return type:

int

Example:

from richter import compute_app
from obspy import stream

stream = read('/path/to/stream.msd')
app = compute_app(stream, 'MEPAS', component='Z')
print(app)
richter.ml.compute_bpptkg_ml(wa_ampl)

Compute BPPTKG Richter magnitude scales using Wood-Anderson amplitude.

Note that Wood Anderson zero to peak amplitude (wa_ampl) is in mm. Calibration function log10(A0) for BPPTKG seismic network is -1.4.

Parameters:wa_ampl (float) – Wood-Anderson zero to peak amplitude in mili-meter.
Returns:BPPTKG Richter magnitude scale.
Return type:float

Richter magnitude scale is computed using the following equation:

ml = log10(wa_ampl) - log10(A0)

where log10(A0) equal to -1.4 and ml is Richter local magnitude scale.

Example:

from richter import compute_bpptkg_ml

# Wood Anderson zero to peak amplitude in mm
wa_ampl = 5

ml = compute_bpptkg_ml(wa_ampl)
print(ml)
richter.ml.compute_ml(stream, station, network='VG', component='Z', **kwargs)

Compute Richter magnitude scales.

Parameters:
  • stream (obspy.core.stream.Stream) – ObsPy waveform stream object.
  • station (str) – Seismic station name, e.g. MEPAS, MEGRA, etc.
  • network (str) – Seismic network name, default to VG.
  • component (str) – Seismic station component, e.g E, N, Z, default to Z.
Returns:

BPPTKG Richter magnitude scale.

Return type:

float

Example:

from richter import compute_ml
from obspy import read

stream = read('/path/to/stream.msd')
ml = compute_ml(stream, 'MEPAS', component='Z')
print(ml)
richter.ml.compute_seismic_energy(m)

Compute seismic energy using Gutenberg-Richter equation.

\[log E = 11.8 + 1.5M\]

where \(M\) is Richter local magnitude and \(E\) is energy in ergs.

Parameters:m (float) – Richter local magnitude.
Returns:Seismic energy in factor of \(10^{12}\) ergs.
Return type:float

Example:

from richter import compute_seismic_energy

ml = 1.5
energy = compute_seismic_energy(ml)
print(energy)
richter.ml.compute_seismic_energy_from_stream(stream, station, network='VG', component='Z', **kwargs)

Compute seismic energy using Gutenberg-Richter equation using stream as input.

Seismic energy is computed using the following equation:

\[log E = 11.8 + 1.5M\]

where \(M\) is Richter local magnitude and \(E\) is energy in ergs.

Parameters:
  • stream (obspy.core.stream.Stream) – ObsPy waveform stream object.
  • station (str) – Seismic station name, e.g. MEPAS, MEGRA, etc.
  • network (str) – Seismic network name, default to VG.
  • component (str) – Seismic station component, e.g E, N, Z, default to Z.
Returns:

Seismic energy in factor of \(10^{12}\) ergs.

Return type:

float

Example:

from richter import compute_seismic_energy_from_stream
from obspy import read

stream = read('/path/to/stream.msd')
energy = compute_energy_from_stream(stream, 'MEPAS', component='Z')
print(energy)
richter.ml.compute_wa(stream, station, network='VG', component='Z', **kwargs)

Compute stream Wood-Anderson amplitude in meter.

Parameters:
  • stream (obspy.core.stream.Stream) – ObsPy waveform stream object.
  • station (str) – Seismic station name, e.g. MEPAS, MEGRA, etc.
  • network (str) – Seismic network name, default to VG.
  • component (str) – Seismic station component, e.g E, N, Z, default to Z.
Returns:

Wood-Anderson zero to peak amplitude in meter.

Return type:

float

Exampe:

from richter import compute_wa
from obspy import read

stream = read('/path/to/stream.msd')
wa_ampl = compute_wa(stream, 'MEPAS', component='Z')
print(wa_ampl)
richter.ml.filter_stream(stream, **kwargs)

Filter ObsPy stream object.

Parameters:stream (obspy.core.stream.Stream) – ObsPy waveform stream object.

Example:

from richter import filter_stream
from obspy import read

stream = read('/path/to/stream.msd')
print(stream)

filtered_stream = filter_stream(
    stream, network='VG', station='MEPAS', component='Z')
print(filtered_stream)

richter.paz

List poles and zeros constants of BPPTKG seismic stations.

richter.paz.get_paz(station, component=None)

Get PAZ response for certain station and component. If component is None, it returns PAZ info for all components. Otherwise, it returns info for specific component.

Example:

from richter import paz

paz_info = paz.get_paz('MEPAS', component='Z')
print(paz_info)

richter.utils

Package utility module.

richter.utils.find_executable(executable, path=None)

Find full path executable command.

richter.utils.generate_safe_random_filename(extension='txt')

Generate safe random filename based on UUID4.

richter.utils.stringify_parameters(items)

Convert all items in list to string.

richter.utils.to_pydatetime(*args, **kwargs)

Convert date string to Python datetime.

richter.version

Package version module.

richter.version.get_version()

Get package version string.

richter.version.get_version_as_tuple()

Get package version as tuple.