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
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)
# 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
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
full_mt,deviatoric,double_couple,vlvdparameterisationsproblem_typetools/generate_fundamental_gf_hdf5.py)elastic10moment-tensor synthesis — both verified bit-close against pyrocko (store.getandstore.calc_seismograms); usable directly byfocus forward/focus go. Thread-safe LRU trace cache.focus responseimpulse/boxcar/triangular/half_sineproblems[].bandpass)problems[].bounds)netcdf-cxx4is available)libmseedis available)BootstrapEngine, verified withmpirun -np 2)focus harvest)focus report)init,check,go,forward,harvest,response,mt,report,versionBuilding
Optional dependencies (will be used automatically if found):
Run the CLI:
Run tests:
Project layout
Key C++ modules ported from Grond
core/mt_synthesis.*(fundamental Green’s functions)core/stf.*problem_type)core/source_model.*core/gf_store.*(InMemoryGFStore)core/waveform_misfit.*,core/trace.*core/problem.*core/bootstrap_weights.*,core/bootstrap.*,core/bootstrap_analysis.*core/highscore_optimiser.*,core/chains.*core/model_history.*core/moment_tensor.*gf/okada.*,gf/projection.*,gf/quadtree.*,core/satellite_target.*,core/gnss_target.*core/target_analyser.*io/sac_io.*io/result_writer.*License
This project is licensed under the GNU General Public License v3.0 or later. See
LICENSEfor details.