ObsPy in the Browser

Proof-of-concept · Seismology tools powered by Python & WebAssembly — no server required

Initializing Python environment…
Events & Stations: Browse recent earthquakes, find nearby stations, and link directly to data processing and TauP ray paths.
1 · events
2 · networks
3 · stations
4 · availability
Data Fetching: Fetch seismic waveforms from FDSN web services and visualize them.

Results

Beachball: Plot focal mechanism beach balls from strike/dip/rake or a full moment tensor.
TauP: Seismic travel time curves and ray paths using the iasp91 or ak135 velocity model.

About This Demo

This demo runs ObsPy — a full Python seismology library — entirely in your browser. There is no server doing any computation. When the page loads, a Python interpreter compiled to WebAssembly is bootstrapped, ObsPy and its dependencies are installed into an in-browser virtual filesystem, and from that point all data processing happens locally on your machine.

Seismic waveforms are fetched on demand from public FDSN web services. Earthquake catalogue data comes from the USGS Earthquake Hazards Program. No personal data is collected or transmitted.

This is a proof-of-concept put together by Matthias Meschede at QuantStack, which specialises in open-source scientific computing infrastructure. Questions, feedback, or interest in building similar tools: info@quantstack.net

How It Works

  1. The pyjs runtime (Python compiled to WebAssembly via Emscripten) loads in your browser.
  2. ObsPy, NumPy, SciPy, Matplotlib and their dependencies are downloaded and unpacked into an in-browser filesystem.
  3. Python modules are imported — this happens once per page load.
  4. All subsequent data fetching, processing, and plotting runs as ordinary Python code, fully client-side.

Design Choices & Trade-offs

The central question this demo poses is: which parts of a seismological web application should live in Python, and which in JavaScript? For a demo, the answer is deliberately biased toward Python — the point is to show that ObsPy runs in the browser at all. A production application would be more selective.

Some operations belong in JavaScript regardless. FDSN data queries, station availability checks, and event catalogue requests are straightforward HTTP calls; native browser fetch() handles them efficiently, integrates naturally with the browser event loop, and requires no WebAssembly overhead. Keeping these in JavaScript also makes CORS handling more transparent.

Other operations are genuinely better in Python. TauP ray tracing, waveform processing, instrument response removal, spectrograms, and beachballs all rely on ObsPy, SciPy, and Matplotlib — a mature, battle-tested scientific stack with no serious JavaScript equivalent. For those, routing through Python is not a demo choice but the right choice.

Acknowledgements

This demo builds on a large stack of open-source scientific software. Key components:

ObsPySeismology in Python — LGPL-3.0
NumPyArray computing — BSD 3-Clause
SciPyScientific computing — BSD 3-Clause
MatplotlibPlotting — PSF-based license
pyjsPython → WebAssembly runtime — BSD 3-Clause
EmscriptenC/C++ → WebAssembly compiler — MIT
LeafletInteractive maps — BSD 2-Clause
CARTOBasemap tiles — CC BY 3.0 · © OpenStreetMap contributors

Parts of this interface were developed with the assistance of AI coding tools. All code was reviewed, directed, and extensively iterated on by human contributors with domain expertise in seismology and scientific software. The AI acted as an accelerator, not an author. If you believe any part of this software infringes a copyright, please contact info@quantstack.net immediately.