Sourcespec Readthedocs Io en Latest
Sourcespec Readthedocs Io en Latest
Release 1.5+32.g5864e1a.dirty
Claudio Satriano
1 SourceSpec 3
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Spectral model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Configuration File 5
3 SourceSpec API 13
3.1 ssp_setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 ssp_read_traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 ssp_process_traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 ssp_build_spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5 ssp_plot_traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.6 ssp_local_magnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.7 ssp_inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.8 ssp_spectral_model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.9 ssp_residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.10 ssp_correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.11 ssp_output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.12 ssp_plot_spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.13 ssp_util . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.14 spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.15 config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Index 21
i
ii
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
SourceSpec is a collection of command line programs (written in Python) to determine earthquake source parameters
(seismic moment 𝑀0 , corner frequency 𝑓𝑐 ) and the inelastic attenuation term (𝑡* ), from the modeling of waveform
spectra.
Other parameters (source radius 𝑟0 , stress drop ∆𝜎) are computed from the inverted ones. The quality factor 𝑄 is
determined from 𝑡* .
As a bonus, local magnitude 𝑀𝑙 is computed as well.
SourceSpec is composed of the following programs:
• source_spec: inverts the S-wave displacement spectra from station recordings of a single event.
• ssp_residuals: computes station residuals from source_spec output.
• source_model: direct spectral modelling.
Contents:
Contents 1
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
2 Contents
CHAPTER 1
SourceSpec
1.1 Overview
source_spec inverts the S-wave displacement spectra from station recordings of a single event.
The Fourier spectrum of the S-wave displacement in far field can be modelled as the product of a source term (Brune
model) and a propagation term (geometric and anelastic attenuation of body waves):
(︂ )︂
1 2𝑅ΘΦ 1 −𝜋𝑟𝑓
𝑆(𝑓 ) = × 1/2 1/2 5/2 1/2
× 𝑀𝑂 × (︁ )︁2 × exp
𝑟 4𝜋𝜌ℎ 𝜌𝑟 𝛽ℎ 𝛽𝑟 𝑄𝑂 𝑉𝑆
1 + 𝑓𝑓𝑐
where 𝑟 is the hypocentral distance; 𝑅ΘΦ is the radiation pattern coefficient for S-waves; 𝜌ℎ and 𝜌𝑟 are the medium
densities at the hypocenter and at the receiver, respectively; 𝛽ℎ and 𝛽𝑟 are the S-wave velocities at the hypocenter
and at the receiver, respectively; 𝑀𝑂 is the seismic moment; 𝑓 is the frequency; 𝑓𝑐 is the corner frequency; 𝑉𝑆 is the
average S-wave velocity along the wave propagation path; 𝑄𝑂 is the quality factor.
In source_spec, the observed spectra 𝑆(𝑓 ) are converted in moment magnitude 𝑀𝑤 .
The first step is to multiply the spectrum for the hypocentral distance and convert them to seismic moment units:
1/2 1/2 5/2 1/2 (︂ )︂
4𝜋𝜌ℎ 𝜌𝑟 𝛽ℎ 𝛽𝑟 1 −𝜋𝑟𝑓
𝑀 (𝑓 ) ≡ 𝑟 × × 𝑆(𝑓 ) = 𝑀𝑂 × (︁ )︁2 × exp
2𝑅ΘΦ 𝑓 𝑄𝑂 𝑉𝑆
1+ 𝑓𝑐
3
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
Then the spectrum is converted in unities of magnitude (the 𝑌𝑑𝑎𝑡𝑎 (𝑓 ) vector used in the inversion):
2
𝑌𝑑𝑎𝑡𝑎 (𝑓 ) ≡ × (log10 𝑀 (𝑓 ) − 9.1)
3
The data vector is compared to the teoretical model:
⎡ ⎛ ⎞ ⎤
(︂ )︂
2⎢ 1 −𝜋𝑟𝑓 ⎟
𝑌𝑑𝑎𝑡𝑎 (𝑓 ) = ⎣log10 ⎝𝑀𝑂 × (︁ )︁2 × exp ⎠ − 9.1⎦ =
⎜ ⎥
3 𝑓 𝑄𝑂 𝑉𝑆
1+ 𝑓𝑐
⎡ ⎛ ⎞ ⎤
(︂ (︂ )︂)︂
2 2⎢ 1 −𝜋𝑟𝑓
= (log10 𝑀0 − 9.1) + ⎣log10 ⎝ (︁ )︁2 ⎠ + log10 exp
⎜ ⎟ ⎥
3 3 𝑄𝑂 𝑉𝑆
⎦
𝑓
1+ 𝑓𝑐
4 Chapter 1. SourceSpec
CHAPTER 2
Configuration File
Configuration file (default name: source_spec.conf) is a plain text file with keys and values in the form key =
value. Comment lines start with #.
Some fields are comma-separated lists: even if only one element is specified, a comma is always required (e.g.,
ignore_stations = STA01,).
Here is the default config file, generated through source_spec -S:
# Config file for source_spec
# Option to specify non standard instrument codes (e.g., "L" for accelerometer)
instrument_code_acceleration = None
instrument_code_velocity = None
5
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
# Trace units.
# Leave it to 'auto' to let the code decide, based on instrument type.
# Manually set it to 'disp', 'vel' or 'acc' if you have already preprocessed
# the traces.
trace_units = auto
# -------- GENERAL PARAMETERS
# Start time (in seconds) of the noise window, respect to the P arrival time
pre_p_time = 6.0
# Start time (in seconds) of the S-wave window, respect to the S arrival time
pre_s_time = 1.0
7
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
# Maximum accepted percentage of clipped data respect to the total trace lenght
clip_max_percent = 5.0
9
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
11
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
# Specify author name. Leave it to None to use login name on this computer.
author = None
# Optionally, specify agency id
agency_id = None
# Set SourceSpec Mw as preferred
set_preferred_magnitude = False
# Base for all the object ids (smi)
smi_base = "smi:local"
# String to strip from the Origin id when constructing the
# Magnitude and stationMagnitude ids.
smi_strip_from_origin_id = ""
# Template for the Magnitude object id (smi).
# Use $SMI_BASE to indicate smi_base defined above
# Use $ORIGIN_ID to indicate the id of the associated Origin.
smi_magnitude_template = "$SMI_BASE/Magnitude/Origin/$ORIGIN_ID#sourcespec"
# Template for the stationMagnitude object id (smi).
# Use $SMI_BASE to indicate smi_base defined above
# Use $ORIGIN_ID to indicate the id of the associated Origin.
# Use $SMI_MAGNITUDE_TEMPLATE to reuse the template for Magnitude object
# Use $WAVEFORM_ID to indicate the id of the associated waveform.
smi_station_magnitude_template = "$SMI_MAGNITUDE_TEMPLATE#$WAVEFORM_ID"
# Template for the MomentTensor object id (smi) which is used to store
# the scalar moment value.
# Use $SMI_BASE to indicate smi_base defined above
# Use $ORIGIN_ID to indicate the id of the associated Origin.
smi_moment_tensor_template = "$SMI_BASE/MomentTensor/Origin/$ORIGIN_ID#sourcespec"
# Template for the FocalMechanism object id (smi) which is used to store
# the scalar moment value.
# Use $SMI_BASE to indicate smi_base defined above
# Use $ORIGIN_ID to indicate the id of the associated Origin.
smi_focal_mechanism_template = "$SMI_BASE/FocalMechanism/Origin/$ORIGIN_ID#sourcespec"
# -----------------QUAKEML PARAMETERS
SourceSpec API
SourceSpec has a modular structure. Each module corresponds to a specific function or class of functions.
SourceSpec modules are presented below, following the logical order on which they’re used within source_spec.
py.
3.1 ssp_setup
3.2 ssp_read_traces
3.3 ssp_process_traces
3.4 ssp_build_spectra
3.5 ssp_plot_traces
3.6 ssp_local_magnitude
13
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
3.7 ssp_inversion
3.8 ssp_spectral_model
3.9 ssp_residuals
3.10 ssp_correction
3.11 ssp_output
3.12 ssp_plot_spectra
3.13 ssp_util
3.14 spectrum
3.10. ssp_correction 15
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
spectrum.do_spectrum(trace)
Compute the spectrum of an ObsPy Trace object.
3.15 config
• genindex
• modindex
• search
17
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
c
config, 16
s
spectrum, 15
ssp_local_magnitude, 13
ssp_residuals, 14
ssp_spectral_model, 14
ssp_util, 15
19
SourceSpec Documentation, Release 1.5+32.g5864e1a.dirty
G
get_vel() (in module ssp_util), 15
H
hypo_dist() (in module ssp_util), 15
L
local_magnitude() (in module
ssp_local_magnitude), 13
M
mag_to_moment() (in module ssp_util), 15
moment_to_mag() (in module ssp_util), 15
O
objective_func() (in module ssp_spectral_model),
14
Q
quality_factor() (in module ssp_util), 15
S
select_trace() (in module ssp_util), 15
source_radius() (in module ssp_util), 15
spectral_model() (in module ssp_spectral_model),
14
21