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.
  • 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.10.4

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.10.4
File Size Uploaded Provenance Actions
cmt_solutions-2026.10.4.tar.gz 3.8 MB With provenance Details for cmt_solutions-2026.10.4.tar.gz

Built distribution (wheel)

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

Total release size: 7.4 MB

Release files / cmt_solutions-2026.10.4.tar.gz

Download URL cmt_solutions-2026.10.4.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
4568b0151bfb5d5e61b4383e011ef6e74d03cf3220e613cbc980f0a1c94d5c2a
BLAKE2b-256 checksum
How to use checksums
b6cf859b25f91d42b115abe55ea020cdf98ece50e01dc53ba02242e89eb2f93c
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 Oct 26, 2026.

Transparency log

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

Download URL cmt_solutions-2026.10.4-py3-none-any.whl
Size 3.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
67a29e98f6f4993946fd5e949892c8e5be7eeed7b52eee84b613ab00ec5c417b
BLAKE2b-256 checksum
How to use checksums
93c2868278831b7e6681d1f14319b601bd605551b1b7364aca0cd969314e7f11
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 Oct 26, 2026.

Transparency log

Security for cmt-solutions 2026.10.4

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.10.4.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 Oct 26, 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