Earthquake source parameters from P- or S-wave displacement spectra
(c) 2011-2023 Claudio Satriano satriano@ipgp.fr
SourceSpec is a collection of command line tools to compute earthquake source parameters (seismic moment, corner frequency, radiated energy, source size, stress drop) from the inversion of P-wave and S-wave displacement spectra recorded at one or more seismic stations. SourceSpec also computes attenuation parameters (t-star, quality factor) and, as a bonus, local magnitude.
See Madariaga (2011) for a primer on earthquake source parameters and scaling laws.
Go to section Theoretical background below to get more information on how the code works. More details are available on the official SourceSpec documentation.
SourceSpec is written in Python and requires a working Python environment to run (see Installation below). However, since SourceSpec is based on command line, you don't have to know how to code in Python to use it.
The SourceSpec package is made of several command line tools:
source_spec
: Compute earthquake source parameters from the inversion of P- or S-wave spectra.source_model
: Direct modelling of P- or S-wave spectra, based on user-defined earthquake source parameters.source_residuals
: Compute station residuals fromsource_spec
output.clipping_detection
: Test the clipping detection algorithm.plot_sourcepars
: 1D or 2D plot of source parameters from a sqlite parameter file.
If you have seismic recordings in miniSEED format (e.g., traces.mseed
),
metadata in StationXML format (e.g., station.xml
) and event information in
QuakeML format (e.g., event.xml
), then:
- Generate a config file via
source_spec -S
; - Edit the config file variable
station_metadata
to point tostation.xml
file; - Run
source_spec -t traces.mseed -q event.xml
.
Note that the default config parameters are suited for a M<5 earthquake recorded within ~100 km. Adjust
win_length
,noise_pre_time
, and the frequency bands (bp_freqmin_*
,bp_freqmax_*
,freq1_*
,freq2_*
) according to your setup.
After successfully installed SourceSpec (see Installation below), you can get help on the command line arguments used by each code by typing from your terminal:
source_spec -h
(or source_model -h
, or source_residuals -h
).
source_spec
and source_model
require you to provide the path to seismic
traces via the --trace_path
command line argument (see
File formats below).
Information on the seismic event can be stored in the trace header (SAC
format), or provided through a QuakeML file (--qmlfile
) or a HYPO71 or
HYPOINVERSE-2000 file (--hypocenter
). See
File formats below for more information on the supported file
formats.
source_spec
and source_model
require a configuration file. The default file
name is source_spec.conf
, other file names can be specified via the
--configfile
command line argument.
You can generate a sample configuration file through:
source_spec -S
Take your time to go through the generated configuration file (named
source_spec.conf
): the comments within the file will guide you on how to set
up the different parameters.
SourceSpec can read all the trace formats supported by ObsPy.
Two very common choices are:
The SAC format can carry additional information in its header, like event location and origin time, phase picks, instrument sensitivity.
SourceSpec can read event information (event ID, location, origin time) in the following formats:
- QuakeML: SourceSpec will also read phase picks and focal mechanism, if available
- HYPO71
- HYPOINVERSE-2000: SourceSpec will also read phase picks, if available
Event information can also be stored in the SAC file headers (header fields:
EVLA
, EVLO
, EVDP
, O
, KEVNM
).
Phase picks for P and S waves can be read from one of the following formats:
Phase picks can also be stored in the SAC file headers (header fields: A
and
T0
).
Station metadata (coordinates, instrumental response) can be provided in one of the following formats:
Note that SEED RESP and PAZ formats do not contain station coordinates, which should therefore be in the trace header (traces in SAC format).
The station metadata file name or file directory is provided in the
configuration file through the parameter station_metadata
.
Alternatively, instrument sensitivity can be provided in the SAC header or as a
constant in the configuration file. In both cases, use the configuration
parameter sensitivity
.
The SourceSpec main code, source_spec
will produce the following output files
(EVID
is replaced by the actual event ID):
EVID.ssp.yaml
: YAML file containing the estimated spectral parameters (summary values and per station values)EVID.ssp.out
(deprecated): text file containing the estimated spectral parameters (summary values and per station values)EVID.ssp.log
: log file in text format (including the command line arguments, for reproducibility)EVID.ssp.conf
: the input config file (for reproducibility)EVID-residuals.pickle
: station residuals in Python pickle formatEVID.ssp.h
: hypocenter file in HYPO71 format with the estimated moment magnitude (only if an input HYPO71 file is provided)EVID.xml
: updated QuakeML file with the results of the SourceSpec inversion (only if an input QuakeML file is provided)
The following plots will be created, in png, pdf or svg format:
EVID.traces.png[.pdf,.svg]
: trace plotsEVID.ssp.png[.pdf,.svg]
: spectral plotsEVID.sspweight.png[.pdf,.svg]
: spectral weight plotsEVID.boxplot.png[.pdf,.svg]
: box plots for the earthquake source parameters retrieved at each station- Misfit plots, when using "grid search" or "importance sampling" for the spectral inversion
As an option, station maps can be created (requires Cartopy):
EVID.map_mag.png[.pdf,.svg]
: station map with symbols colored by estimated moment magnitudeEVID.map_fc.png[.pdf,.svg]
: station map with symbols colored by estimated corner frequency
As an option, the retrieved source parameters (per station and summary) can be appended to a SQLite database, whose path is defined in the configuration file.
Finally, always as an option, source_spec
can generate a report in HTML
format.
For each station, the code computes P- or S-wave displacement amplitude spectra for each component (e.g., Z, N, E), then combines the component spectra through the root sum of squares:
where
It then inverts spectra for a 3-parameter Brune (1970) source model:
where the three parameters to determine are:
- the seismic moment
$M_0$ - the corner frequency
$f_c$ - the attenuation parameter
$t^*$
and
The inversion is performed in moment magnitude
- TNC: truncated Newton algorithm (with bounds)
- LM: Levenberg-Marquardt algorithm (warning: Trust Region Reflective algorithm will be used instead if bounds are provided)
- BH: basin-hopping algorithm
- GS: grid search
- IS: importance sampling of misfit grid, using k-d tree
Starting from the inverted parameters
- the Brune stress drop
- the source radius
- the quality factor
$Q_0$ of P- or S-waves
Finally, the radiated energy
As a bonus, local magnitude
Event summaries (mean, weighted mean, percentiles) are computed from single station estimates. For mean and weighted mean estimation, outliers are rejected based on the interquartile range rule.
See the official documentation for more details.
Example three-component trace plot (in velocity), showing noise and S-wave windows
Example displacement spectrum for noise and S-wave, including inversion results
SourceSpec requires at least Python 3.6. All the required dependencies will be downloaded and installed during the setup process.
The latest release of SourceSpec is available on the Python Package Index.
You can install it easily through pip
:
pip install sourcespec
Download the latest release from the
releases page,
in zip
or tar.gz
format, then:
pip install sourcespec-X.Y.zip
or
pip install sourcespec-X.Y.tar.gz
Where, X.Y
is the version number (e.g., 1.2
).
You don't need to uncompress the release files yourself.
If you need a recent feature that is not in the latest release (see the
unreleased
section in CHANGELOG), you want to use the source
code from the
SourceSpec GitHub repository.
For that, clone the project:
git clone https://github.com/SeismicSource/sourcespec.git
(avoid using the "Download ZIP" option from the green "Code" button, since
version number is lost), then install the code from within the sourcespec
main directory by running:
pip install .
The official SourceSpec documentation can be find at sourcespec.readthedocs.io.
Several sample runs are available in the sourcespec_testruns repository.
Join the SourceSpec Discussions and feel free to ask!
Please open an Issue.
I'm very open to contributions: if you have new ideas, please open an Issue. Don't hesitate sending me pull requests with new features and/or bugfixes!
If you used SourceSpec for a scientific paper, please cite it as:
Satriano, C. (2023). SourceSpec – Earthquake source parameters from P- or S-wave displacement spectra (X.Y). doi: 10.5281/ZENODO.3688587
Please replace X.Y
with the SourceSpec version number you used.
You can also cite the following abstract presented at the 2016 AGU Fall Meeting:
Satriano, C., Mejia Uquiche, A. R., & Saurel, J. M. (2016). Spectral estimation of seismic moment, corner frequency and radiated energy for earthquakes in the Lesser Antilles. In AGU Fall Meeting Abstracts (Vol. 2016, pp. S13A-2518), bibcode: 2016AGUFM.S13A2518S
- Brune, J. N. (1970). Tectonic stress and the spectra of seismic shear waves from earthquakes, J. Geophys. Res., 75 (26), 4997– 5009, doi: 10.1029/JB075i026p04997
- Lancieri, M., Madariaga, R., Bonilla, F. (2012). Spectral scaling of the aftershocks of the Tocopilla 2007 earthquake in northern Chile, Geophys. J. Int., 189 (1), 469–480, doi: 10.1111/j.1365-246X.2011.05327.x
- Madariaga, R. (2011). Earthquake Scaling Laws. In "Extreme Environmental Events", pp. 364–383, doi: 10.1007/978-1-4419-7695-6_22. Available on ResearchGate.