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 #.

Here is the default config file, generated through source_spec -S:

# Config file for source_spec

# GENERAL PARAMETERS --------
# All the fields are optional.
# The filled in fields will be written to output files.
# Author information
author_name = None
author_email = None
# Agency information
agency_full_name = None
agency_short_name = None
agency_url = None
# the logo can be a local file (it will be copied to the output dir)
# or a URL
agency_logo = None
# -------- GENERAL PARAMETERS

# TRACE AND METADATA PARAMETERS --------
# Channel naming for mis-oriented channels (vertical, horiz1, horiz2):
# Example:
#   mis_oriented_channels = Z,1,2
mis_oriented_channels = None

# Option to specify non standard instrument codes (e.g., "L" for accelerometer)
instrument_code_acceleration = None
instrument_code_velocity = None

# For more complex network.station.location.channel (SCNL) naming scenarios,
# you can provide a file, in json format, with traceid (SCNL) mapping
traceid_mapping_file = None

# List of traceids to ignore.
# Use network.station.location.channel; wildcards are accepted
# Example:
#   ignore_traceids = FR.CIEL.*.*, AM.RA0D3.00.*
ignore_traceids = None

# List of traceids to use.
# Use network.station.location.channel; wildcards are accepted
# Example:
#   use_traceids = FR.CIEL.*.*, AM.RA0D3.00.*
use_traceids = None

# Maximum epicentral distance (km) to process a trace
max_epi_dist = None

# Directory or single file name containing station metadata
# (instrument response and station coordinates).
# Note: this parameter can be overridden by the command line option
#       with the same name.
# Station metadata files can be in one of the following formats:
#   StationXML, dataless SEED, SEED RESP, PAZ (SAC polezero format)
# Notes:
# 1. SourceSpec will not enter in subdirectories of the given directory
#    (only one level allowed)
# 2. Traceid for PAZ files is specified through their name.
#    The traceid (network.station.location.channel) must be in the last four
#    fields (separated by a dot ".") before the file suffix (which can be
#    ".paz", ".pz", or no suffix).
#    Example:
#      PREFIX.NET.STA.LOC.CHAN.paz
#    or (no prefix):
#      NET.STA.LOC.CHAN.paz
#    or (no prefix and no suffix):
#      NET.STA.LOC.CHAN
# 3. If no traceid is specified through the PAZ file name, then it is assumed
#    that this is a generic PAZ, valid for all the stations that do not have
#    a specific PAZ. Use "trace_units" below to specify the units of the
#    generic PAZ.
# 4. SEED RESP and PAZ files do not contain station coordinates, which
#    should therefore be in the trace header (traces in SAC format)
station_metadata = None

# It is also possible to provide a constant sensitivity (i.e., flat instrument
# response curve) as a numerical value or a combination of SAC header fields
# (in this case, traces must be in SAC format).
# This parameter overrides the response curve computed from station_metadata.
# Leave it to None to compute instrument response from station_metadata.
# Examples:
#  sensitivity = 1
#  sensitivity = 1e3
#  sensitivity = resp0
#  sensitivity = resp1*resp2
#  sensitivity = user3/user2
sensitivity = None

# SQLite database file for storing output parameters (optional):
database_file = None

# Correct_instrumental_response (optional, default=True):
correct_instrumental_response = True

# 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
# -------- TRACE AND METADATA PARAMETERS


# TIME WINDOW PARAMETERS --------
# P and S wave velocity (in km/s) for travel time calculation
# (if None, the global velocity model 'iasp91' is used)
# Theoretical P or S arrival times are used when a manual P or S pick is not
# available, or when the manual P or S pick is too different from the
# theoretical arrival (see 'p_arrival_tolerance' and 's_arrival_tolerance'
# below).
vp_tt = None
vs_tt = None
# As an alternative, a directory containing NonLinLoc travel time grids
# can be specified and values defined above will be ignored.
# Note that reading NonLinLoc grids takes time. For simple 1D models, you
# can speed up considerably the process using a generic station
# named "DEFAULT". The coordinates of this default station are not important,
# since they will be superseded by each station's coordinates.
NLL_time_dir = None

# Arrival tolerances (in seconds) to accept a manual P or S pick
p_arrival_tolerance = 4.0
s_arrival_tolerance = 4.0

# Start time (in seconds) of the noise window, respect to the P arrival time
noise_pre_time = 6.0

# Start time (in seconds) of the signal window, respect to the P or S arrival
# times (see "wave_type" below)
signal_pre_time = 1.0

# Length (in seconds) for both noise and signal windows
win_length = 5.0
# -------- TIME WINDOW PARAMETERS


# SPECTRUM PARAMETERS --------
# Wave type to analyse: 'P', 'S', 'SH' or 'SV'
# If 'SH' or 'SV' are selected, traces are rotated in the radial-transverse
# system. Transverse component is used for 'SH', radial component (and
# optionally the vertical component, see 'ignore_vertical' below) is used
# for 'SV'
wave_type = S

# Integrate in time domain (default: integration in spectral domain)
time_domain_int = False

# Ignore vertical components when building S or SV spectra
# Note: this option has no effect when 'wave_type' is 'P' (the vertical
# component is not ignored) and when 'wave_type' is 'SH' (the vertical
# component is not needed)
ignore_vertical = False

# Taper half width: between 0 (no taper) and 0.5
taper_halfwidth = 0.05

# Spectral window length (seconds)
# Signal is tapered, and then zero padded to
# this window length, so that the spectral
# sampling is fixed to 1/spectral_win_length.
# Comment out (or set to None) to use
# signal window as spectral window length.
spectral_win_length = None

# Spectral smoothing window width in frequency decades
# (i.e., log10 frequency scale).
# Example:
#  spectral_smooth_width_decades=1 means a width of 1 decade
#  (generally, too large, producing a spectrum which is too smooth).
#  spectrum(f0) is smoothed using values between f1 and f2, so that
#  log10(f1)=log10(f0)-0.5 and log10(f2)=log10(f0)+0.5
#    i.e.,
#  f1=f0/(10^0.5) and f2=f0*(10^0.5)
#    or,
#  f2/f1=10 (1 decade width)
# Default value of 0.2 is generally a good choice
spectral_smooth_width_decades = 0.2

# Residuals file path
# (a pickle file with the mean residuals per station,
# used for station correction):
residuals_filepath = None

# Remove the signal baseline after instrument correction and before filtering
remove_baseline = False

# Band-pass frequencies (Hz) for accelerometers, velocimeters
# and displacement sensors.
# Use bp_freqmin_STATION and bp_freqmax_STATION to provide
# filter frequencies for a specific STATION code.
# TODO: calculate from sampling rate?
bp_freqmin_acc    = 1.0
bp_freqmax_acc    = 50.0
bp_freqmin_shortp = 1.0
bp_freqmax_shortp = 40.0
bp_freqmin_broadb = 0.5
bp_freqmax_broadb = 40.0
bp_freqmin_disp   = 0.5
bp_freqmax_disp   = 40.0

# Spectral windowing frequencies (Hz) for accelerometers, velocimeters
# and displacement sensors.
# (spectra will be cut between these two frequencies)
# Use freq1_STATION and freq2_STATION to provide
# windowing frequencies for a specific STATION code.
freq1_acc     = 1.0
freq2_acc     = 30.0
freq1_shortp  = 1.0
freq2_shortp  = 30.0
freq1_broadb  = 0.5
freq2_broadb  = 30.0
freq1_disp    = 0.5
freq2_disp    = 30.0
# -------- SPECTRUM PARAMETERS


# SIGNAL/NOISE PARAMETERS --------
# Minimum rms (in trace units before instrument corrections)
# to consider a trace as noise
rmsmin = 0

# Time domain S/N ratio min
sn_min = 0

# Clipping detection algorithm
# Options:
#  - 'none': no clipping detection
#  - 'clipping_score': compute a clipping score for each trace, based on the
#    shape of the kernel density estimation of the trace amplitude values.
#    A high clipping score will be obtained for traces with a high number of
#    samples whose amplitude is close to the trace highest or lowest
#    amplitude values. Clipping scores for each trace are printed on the
#    terminal and in the log file.
#    Note: if "remove_baseline" is True (see above), clipping scores are
#    computed on the baseline-corrected signal.
#  - 'clipping_peaks': count the number of peaks in the kernel density
#    estimation of the trace amplitude values. The trace is considered clipped
#    if at least one peak is found within the trace highest or lowest amplitude
#    values. Kernel density peaks for each trace are printed on the terminal
#    and in the log file.
clipping_detection_algorithm = clipping_score
# Plot a debug figure for each trace with the results of the clipping algorithm
# Note: the figures are always shown, even if "plot_show" is False (see below)
clipping_debug_plot = False
# Threshold for the 'clipping_score' algorithm (between 0 and 100).
# A value of 100 means no clipping detection.
# This parameter is ignored if "clipping_detection_algorithm" is not set to
# 'clipping_score'.
clipping_score_threshold = 10
# Sensitivity for the 'clipping_peaks' algorithm (between 1 and 5).
# Higher values mean more peaks are detected.
# This parameter is ignored if "clipping_detection_algorithm" is not set to
# 'clipping_peaks'.
clipping_peaks_sensitivity = 3
# Trace amplitude percentile for the 'clipping_peaks' algorithm (between 0
# and 100). Example:
#   clipping_peaks_percentile = 10
# means that the 10% highest and lowest values of the trace amplitude will be
# checked for clipping.
# A value of 0 means that no clipping check will be performed.
# This parameter is ignored if "clipping_detection_algorithm" is not set to
# 'clipping_peaks'.
clipping_peaks_percentile = 10

# Maximum gap length for the whole trace, in seconds
gap_max = None
# Maximum overlap length for the whole trace, in seconds
overlap_max = None

# Spectral S/N ratio min, below which a spectrum will be skipped
spectral_sn_min = 0
# Frequency range (Hz) to compute the spectral S/N ratio
# (comment out or use None to indicate the whole frequency range)
# Example:
#  spectral_sn_freq_range = 0.1, 2
spectral_sn_freq_range = None
# -------- SIGNAL/NOISE PARAMETERS


# SPECTRAL MODEL PARAMETERS --------
# P and S wave velocity close to the source (km/s)
vp_source = 5.5
vs_source = 3.2
# P and S wave velocity close to the stations (km/s)
# If set to None, velocity values close to the source will be used
vp_stations = None
vs_stations = None
# Note: if both v(p,s)_source and v(p,s)_stations are set to None, then
# velocities will be extracted from the global velocity model 'iasp91'
# As an alternative, a directory containing a NonLinLoc model can be specified
# In this case, the values provided above will be ignored
NLL_model_dir = None
# Density (kg/m3):
rho = 2500
# P-wave average radiation pattern coefficient:
rpp = 0.52
# S-wave average radiation pattern coefficient:
rps = 0.62
# Radiation pattern from focal mechanism, if available
rp_from_focal_mechanism = False
# Geometrical spreading correction of wave amplitude.
# Spectra will be multiplied by this value to correct for the lost amplitude.
# Possible options are:
#    'r_power_n':  "r" to the power of "n" (rⁿ).
#                  You must provide the value of the exponent "n"
#                  (see "geom_spread_n_exponent" below).
#    'boatwright': "r" (body waves) geometrical spreading for hypocentral
#                  distances below a cutoff distance; frequency-dependent
#                  geometrical spreading above the cutoff distance (Boatwright
#                  et al., 2002). You must provide the cutoff distance (see
#                  "geom_spread_cutoff_distance" below).
geom_spread_model = r_power_n
# Exponent "n" for the "r_power_n" geometrical spreading coefficient (positive
# float). Examples:
#   geom_spread_n_exponent = 1 (default, body wave in a homogeneous full-space)
#   geom_spread_n_exponent = 0.5 (surface wave in a homogeneous half-space)
geom_spread_n_exponent = 1
# Geometrical spreading cutoff distance, in km, for the "boatwright" model:
geom_spread_cutoff_distance = 100
# -------- SPECTRAL MODEL PARAMETERS


# INVERSION PARAMETERS --------
# Weighting type: 'noise', 'frequency' or 'no_weight'
weighting = noise
# Parameters for 'frequency' weighting (ignored for 'noise' weighting):
#   weight for f<=f_weight (Hz)
#   1      for f> f_weight (Hz)
f_weight = 7.
weight = 10.

# Initial value for t_star (seconds)
t_star_0 = 0.045
# Try to invert for t_star_0.
# If the inverted t_star_0 is non-positive, then fixed t_star_0 will be used
invert_t_star_0 = False
# Allowed variability around inverted t_star_0 in the main inversion
# (expressed as a fraction of t_star_0, between 0 and 1).
# If the inverted t_star_0 is non-positive, then t_star_min_max is used
# (see below).
t_star_0_variability = 0.1
# Inversion algorithm:
# 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
inv_algorithm = TNC
# Parameter bounds:
# Notes:
# 1. Mw bounds are autoset between 0.9*min(Mw(f)) and 1.1*max(Mw(f)),
#    where Mw(f) is the low frequency spectral plateau in magnitude units.
#    If noise weighting is used, frequencies for which S/N(f) < 0.5*max(S/N(f))
#    will be ignored, where S/N(f) is the spectral signal to noise ratio.
# 2. If not specified, fc bounds will be autoset to fc0/10 and fc0*10, i.e. two
#    decades around fc0. The value of fc0 is set as the first maximum of
#    spectral S/N (noise weighting), or at "f_weight" (frequency weighting),
#    or at half of the frequency window (no weighting)
# 3. Specify bounds as a list, ex.:
#      fc_min_max = 0.1, 40
#    (comment out or use None to indicate no bound)
fc_min_max = None
# t_star_min_max does not supersede t_star_0_variability
t_star_min_max = 0.001, 0.25
# optional : Qo bounds (converted into t_star bounds in the code).
# (comment out or use None to indicate no bound)
# Note: if you want to explore negative t_star values, you have to specify
# -Qo_min, Qo_min. This because t_star is proportional to 1/Qo.
# Example, for searching only positive t_star values:
#   Qo_min_max = 10, 1000
# If you want to search also negative t_star values:
#   Qo_min_max = -10, 10
Qo_min_max = None
# -------- INVERSION PARAMETERS

# POST-INVERSION PARAMETERS --------
# Post-inversion bounds: use this bounds to reject certain inversion
# results, per station.
# Sometimes it is better to be more permissive with inversion parameters and
# reject "bad" solutions after the inversion, rather than forcing the
# inversion to converge within strict bounds.
# fc bounds, in Hz
pi_fc_min_max = None
# t_star bounds, in s
pi_t_star_min_max = None
# Brune stress drop bounds, in MPa
pi_bsd_min_max = None
# Maximum acceptable misfit between inverted and observed spectrum
pi_misfit_max = None
# -------- POST-INVERSION PARAMETERS


# RADIATED-ENERGY PARAMETERS --------
# Maximum frequency (Hz) to measure radiated energy Er
# (above this frequency, the finite-band correction
# of Di Bona & Rovelli, 1988, will be applied)
max_freq_Er = None
# -------- RADIATED-ENERGY PARAMETERS


# LOCAL MAGNITUDE PARAMETERS --------
compute_local_magnitude = False
# Local magnitude parameters:
#   ml = log10(A) + a * log10(R/100) + b * (R-100) + c
# where A is the maximum W-A amplitude (in mm)
# and R is the hypocentral distance (in km)
# Default values (for California) are:
#   a = 1., b = 0.00301, c = 3.
a = 1.
b = 0.00301
c = 3.
# Band-pass filtering frequencies (Hz) for local magnitude
ml_bp_freqmin = 0.1
ml_bp_freqmax = 20.0
# -------- LOCAL MAGNITUDE PARAMETERS


# SUMMARY STATISTICS PARAMETERS --------
# For each spectral parameter, SourceSpec computes three different summary
# estimates (from station estimates), using the following statistics:
#  - mean
#  - weighted_mean
#  - percentiles
# All the three summary estimates are stored in the YAML and SQLite output,
# but only a reference one is used for map plots, QuakeML and HYPO output,
# as well as for the "Event Summary" section in HTML report and for computing
# station spectral residuals.
# Use the parameter "reference_statistics" to specify the reference summary
# statistics that will be used in the cases described above.
reference_statistics = weighted_mean
# Number of sigmas (standard deviations) for average and weighted average
# uncertainty estimation
n_sigma = 1
# Percentage levels to compute lower, mid and upper percentiles
#   Example: to mimic a Gaussian distribution (one-sigma, 68.2% confidence):
#       lower_percentage = 15.9
#       mid_percentage = 50
#       upper_percentage = 84.1
# Note: the confidence level is upper_percentage - lower_percentage
lower_percentage = 15.9
mid_percentage = 50
upper_percentage = 84.1
# Reject outliers before computing means (standard and weighted),
# using the IQR method.
# IQR is the interquartile range Q3-Q1, where Q1 is the 25% percentile
# and Q3 is the 75% percentile.
# Values that are smaller than (Q1 - nIQR*IQR) or larger than (Q3 + nIQR*IQR)
# will be rejected as outliers.
# Set nIQR to None to disable outlier rejection.
# Note: this parameter also controls the position of "whiskers" on the source
# parameter box plots.
nIQR = 1.5
# -------- SUMMARY STATISTICS PARAMETERS


# PLOT PARAMETERS --------
# Show interactive plots (slower)
plot_show = False
# Save plots to disk
plot_save = True
# Plot file format: 'png', 'pdf', 'pdf_multipage' or 'svg'
plot_save_format = png
# Plots an extra synthetic spectrum with no attenuation
plot_spectra_no_attenuation = False
# Plots an extra synthetic spectrum with no fc
plot_spectra_no_fc = False
# Max number of rows in plots
plot_spectra_maxrows = 3
plot_traces_maxrows = 3
# Plot ignored traces (clipped or low S/N)
plot_traces_ignored = True
# Plot ignored spectra (low S/N)
plot_spectra_ignored = True
# Plot station map
plot_station_map = False
# Plot station names on map
plot_station_names_on_map = False
# Text size for station names
plot_station_text_size = 8
# Coastline resolution
# Use None to let the code autoset the coastline resolution.
# Otherwise choose one of: 'full', 'high', 'intermediate', 'low' or 'crude'
plot_coastline_resolution = None
# Zoom level for map tiles
# Use None to let the code autoset the zoom level
# Otherwise choose an integer between 1 (minimum zoom) and 18 (maximum zoom)
# Note: for zoom levels larger than 11, some map tiles could be missing
plot_map_tiles_zoom_level = None
# -------- PLOT PARAMETERS


# HTML REPORT --------
# Generate an HTML page summarizing the results of this run
# Note: "plot_save_format" (above) must be "png" or "svg"
html_report = False
# Link to event page. If set, the event ID on the HTML page will be a link to
# the event page. Use $EVENTID to indicate the current event ID.
# Example:
#   event_url = https://earthquake.usgs.gov/earthquakes/eventpage/$EVENTID/executive
event_url = None
# -------- HTML REPORT


# QUAKEML PARAMETERS ----------------
# Parameters for QuakeML output.
#
# A QuakeML file will be generated only if QuakeML is used for input.
# The output file will be based on the input file, with additional information
# on seismic moment, Mw and source parameters computed by SourceSpec.
# Note: if you don't understand the parameters below, then probably you
# don't need QuakeML output and you can leave all the parameters to their
# default value

# 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