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
.
ssp_setup¶
Setup functions for sourcespec.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
-
ssp_setup.
configure
(progname='source_spec')[source]¶ Parse command line arguments and read config file.
Returns a
Config
object.
-
ssp_setup.
setup_logging
(config, basename=None, progname='source_spec')[source]¶ Setup the logging infrastructure.
This function is typically called twice: the first time without basename and a second time with a basename (typically the eventid). When called the second time, the previous logfile is renamed using the given basename.
ssp_read_traces¶
Read traces in multiple formats of data and metadata.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
|
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_process_traces¶
Trace processing for sourcespec.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_build_spectra¶
Build spectral objects.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_plot_traces¶
Trace plotting routine.
copyright: | 2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_local_magnitude¶
Local magnitude calculation for sourcespec.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_inversion¶
Spectral inversion routines for sourcespec.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_spectral_model¶
Spectral model and objective function.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
-
ssp_spectral_model.
objective_func
(xdata, ydata, weight)[source]¶ Objective function generator for bounded inversion.
-
ssp_spectral_model.
spectral_model
(freq, Mw, fc, t_star, alpha=1.0)[source]¶ Spectral model.
\[Y_{data} = M_w + \frac{2}{3} \left[ - \log_{10} \left( 1+\left(\frac{f}{f_c}\right)^2 \right) - \pi \, f t^* \log_{10} e \right]\]see source_spec for a detailed derivation of this model.
ssp_residuals¶
Spectral residual routine for sourcespec.
copyright: |
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_correction¶
Spectral station correction calculated from ssp_residuals.
copyright: |
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_output¶
Output functions for source_spec.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_plot_spectra¶
Spectral plotting routine.
copyright: | 2012 Claudio Satriano <satriano@ipgp.fr>
2015-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
ssp_util¶
Utility functions for sourcespec.
copyright: | 2012-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
-
ssp_util.
calc_dist
(lat1, lon1, lat2, lon2)[source]¶ Distance between two point on the earth.
Haversine formula: http://www.movable-type.co.uk/scripts/latlong.html
spectrum¶
A Spectrum() class defined as a modification of the ObsPy class Trace().
Provides the high-level function do_spectrum() and the low-level funciton do_fft().
copyright: | 2012-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |
config¶
Config class for sourcespec.
copyright: | 2013-2020 Claudio Satriano <satriano@ipgp.fr> |
---|---|
license: | CeCILL Free Software License Agreement, Version 2.1 (http://www.cecill.info/index.en.html) |