Skip to main content

CMT Solutions

This repository contains the Centroid Moment Tensor (CMT) solutions and supporting tools used for the John Townend relocation / CMT study.

Contents

  • cmt_solutions/ — Python package with helpers for reading and working with CMT solution data (includes cmt_data.py, nodal_plane.py, etc.).
  • auto_cmt/ — runs BayesISOLA's automated 1-D CMT inversion for a single GeoNet event (run_cmt.py), for any event already in GeoNet's archive or, with --real-time, for one that has only just happened. Installed as the auto_cmt package so callers can launch it as a subprocess (python -m auto_cmt.run_cmt ...); see NZGMDB's nzgmdb.management.background for an example launcher. run_event.py runs the three production runs of an event (all_stations, azimuth, drop_outliers_dev) one after another, sharing the download and Green's functions and drawing each run's figures in the background (see the Auto CMT wiki page).
  • cmt_solutions/data/ — CSV datasets (e.g. CMT_solutions.csv) used by the code and reviewer app.
  • interfaces/ — Streamlit UI for reviewing nodal planes (cmt_reviewer.py).
  • scripts/ — utility scripts used to build or update datasets.
  • wiki/ — documentation pages including the CMT review guide, the auto CMT guide, and the John Townend study notes.

Quick links (wiki)

  • CMT Review guide: wiki/CMT Review.md
  • Auto CMT guide: wiki/Auto CMT.md
  • John Townend CMT study notes: wiki/John Townend CMT Study.md
  • Home (scripts summary): open wiki/Home.md for descriptions of the scripts in scripts/.

Install

We recommend using a new Python virtual environment. From the repository root (the directory containing pyproject.toml / setup.py) install editable mode so the package is importable during development and by the Streamlit app:

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements.txt

Running the Streamlit reviewer

From the repo root:

cd interfaces
streamlit run cmt_reviewer.py

Open the URL printed by Streamlit (usually http://localhost:8501). The wiki/CMT Review.md file contains a user guide for the reviewer UI and describes the steps to perform and save reviews.


Using the Python API

This repository exposes a small API for loading and working with the CMT data. The main helper for loading the data is get_cmt_data() in cmt_solutions/cmt_data.py.

Example: load all CMT solutions

from cmt_solutions.cmt_data import get_cmt_data

df_all = get_cmt_data()  # returns a pandas.DataFrame with the full contents of cmt_solutions/data/CMT_solutions.csv
print(len(df_all), "rows loaded")

Example: load a single event by PublicID

from cmt_solutions.cmt_data import get_cmt_data

df_event = get_cmt_data(event_id="2016p858000")

Reviewed-plane convention

When reviewing a CMT solution using the Streamlit app, the selected (preferred) plane is stored in the first plane columns and the other (alternative) plane in the second plane columns. Concretely:

  • Preferred (chosen) plane -> strike1, dip1, rake1
  • Other (non-preferred) plane -> strike2, dip2, rake2
  • The PreferredPlane column is set to the chosen value ("1" or "2"), and the reviewer name and reviewed flag are recorded.

This means consumers of CMT_solutions.csv can always treat the first plane as the preferred plane when reviewed == True.

Working with reviewed results

The Streamlit reviewer writes the full working table (including reviewed, reviewer) to the output CSV you specify in the UI. You can use this file directly or replace cmt_solutions/data/CMT_solutions.csv with your reviewed file to share results.

To contribute reviewed results back to the repository follow the steps in the wiki/CMT Review.md guide.

Metadata

Release files for cmt-solutions 2026.11.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmt-solutions 2026.11.3
File Size Uploaded Provenance Actions
cmt_solutions-2026.11.3.tar.gz 3.8 MB With provenance Details for cmt_solutions-2026.11.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmt-solutions 2026.11.3
File Interpreter ABI Platform Actions
cmt_solutions-2026.11.3-py3-none-any.whl Python 3 none any Details for cmt_solutions-2026.11.3-py3-none-any.whl

Total release size: 7.4 MB

Release files / cmt_solutions-2026.11.3.tar.gz

Download URL cmt_solutions-2026.11.3.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
adbc0c16b2a3c24cb17e440e6d480c4875c328c00ba4dc60fc1b8e5bde9ef4e9
BLAKE2b-256 checksum
How to use checksums
6c8b77efac63ab97bd8b22e0e0c8dfb17314ffa552d43f9dd6cf4a306583b369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / cmt_solutions-2026.11.3-py3-none-any.whl

Download URL cmt_solutions-2026.11.3-py3-none-any.whl
Size 3.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
56359fd08f7b3268a48ad64dd1bdc24c94109265e1e1af182d08c957a2442393
BLAKE2b-256 checksum
How to use checksums
672620eb3f143cb3232367454f903d6a94fae3312877d529d93c73ac83eaca18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for cmt-solutions 2026.11.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cmt_solutions-2026.11.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page