目录

Focus

Focus is a high-performance, command-line earthquake source inversion framework designed for supercomputing environments. It provides core capabilities comparable to Grond while using C++ for all compute-intensive algorithms and OpenMP for on-node parallelisation.

Features

  • Moment tensor (MT) and double-couple (DC) inversion
    • full_mt, deviatoric, double_couple, vlvd parameterisations
    • MT decomposition into DC / CLVD / ISO percentages
    • source model selected from the config problem_type
  • Physically-based seismic forward model: moment-tensor radiation-pattern synthesis from fundamental Green’s functions (Herrmann / Jost & Herrmann 1989) for Z/R/T components
  • Built-in analytic GF store so the full forward/inversion chain runs and is verifiable end-to-end without an external Green’s function database
  • HDF5 seismic GF backend with (distance, depth) bilinear interpolation over a fundamental Green’s function grid (generator: tools/generate_fundamental_gf_hdf5.py)
  • Pyrocko/Fomosto native GF store reader (config + index + mmap’d traces) with pyrocko’s elastic10 moment-tensor synthesis — both verified bit-close against pyrocko (store.get and store.calc_seismograms); usable directly by focus forward / focus go. Thread-safe LRU trace cache.
  • Instrument response removal from StationXML poles-and-zeros (spectral deconvolution), matched to pyrocko’s transfer function; focus response
  • Source time functions: impulse / boxcar / triangular / half_sine
  • Zero-phase Butterworth band-pass filtering of waveforms (problems[].bandpass)
  • Configurable per-parameter search bounds (problems[].bounds)
  • Rectangular / finite-fault source models
  • Multi-data joint inversion: seismic waveforms, InSAR, GNSS
  • Grond-style waveform misfits: time / frequency / log-frequency / envelope / absolute / cc_max_norm domains
  • Bayesian and classic bootstrap weights and residuals
  • HighScore / BABO optimiser with uniform → directed → convergence phases
  • Differential Evolution optimiser (fallback)
  • OpenMP-parallel model evaluation, optimisation, and bootstrap resampling
  • Static GF engine: Okada rectangular dislocation for InSAR/GNSS
  • InSAR helpers: LOS projection, quadtree subsampling, orbital ramps
  • Target noise analysis and automatic balancing weights
  • SAC waveform I/O (standard-compliant headers + endianness detection; interoperates with pyrocko/ObsPy)
  • HDF5 result output and Markdown reports
  • NetCDF-4 result output (when netcdf-cxx4 is available)
  • MiniSEED waveform input (when libmseed is available)
  • MPI-distributed bootstrap (BootstrapEngine, verified with mpirun -np 2)
  • Ensemble harvesting across runs with 16/50/84 percentiles and covariance (focus harvest)
  • HTML report with pyrocko beachball, convergence and parameter-trace plots (focus report)
  • Command-line driven workflow: init, check, go, forward, harvest, response, mt, report, version

Building

mkdir build && cd build
cmake .. -DFOCUS_ENABLE_OPENMP=ON -DFOCUS_BUILD_TESTS=ON
make -j

Optional dependencies (will be used automatically if found):

# Ubuntu / Debian
sudo apt-get install libhdf5-dev libyaml-cpp-dev libfftw3-dev libnetcdf-c++4-dev libmseed-dev

Run the CLI:

# Create a project skeleton with a template config
./apps/focus init my_project

# Generate synthetic waveforms from the 'forward' source (built-in analytic GF store)
./apps/focus forward my_project/config.yaml

# Feed them back as observed data and invert
cp my_project/runs/forward/*.sac my_project/data/waveforms/
./apps/focus check my_project/config.yaml
./apps/focus go    my_project/config.yaml

# Or run the bundled examples
./apps/focus check ../data/example_config.yaml
./apps/focus go    ../data/example_highscore_config.yaml

Run tests:

./tests/focus-tests

Project layout

├── apps/              # Command-line application
├── include/focus/     # Public C++ headers
├── src/core/          # Core C++ library
├── src/gf/            # Green's function engines
├── src/io/            # Data I/O and reports
├── tests/             # Unit tests (Catch2)
├── data/              # Example configurations
├── docs/design.md     # Architecture design document
└── docs/roadmap.md    # Grond alignment roadmap

Key C++ modules ported from Grond

Module Files
Moment-tensor waveform synthesis core/mt_synthesis.* (fundamental Green’s functions)
Source time functions core/stf.*
Source model factory (problem_type) core/source_model.*
Analytic GF store core/gf_store.* (InMemoryGFStore)
Waveform misfit (multi-domain) core/waveform_misfit.*, core/trace.*
Global misfit combination core/problem.*
Bootstrap weights / residuals core/bootstrap_weights.*, core/bootstrap.*, core/bootstrap_analysis.*
HighScore / BABO optimiser core/highscore_optimiser.*, core/chains.*
Model history core/model_history.*
Moment tensor decomposition core/moment_tensor.*
InSAR / GNSS static GF gf/okada.*, gf/projection.*, gf/quadtree.*, core/satellite_target.*, core/gnss_target.*
Target noise analysis core/target_analyser.*
SAC I/O io/sac_io.*
Result output / reports io/result_writer.*

License

This project is licensed under the GNU General Public License v3.0 or later. See LICENSE for details.

关于

震源机制解软件

311.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号