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 (includescmt_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 theauto_cmtpackage so callers can launch it as a subprocess (python -m auto_cmt.run_cmt ...); see NZGMDB'snzgmdb.management.backgroundfor an example launcher.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.mdfor descriptions of the scripts inscripts/.
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 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
PreferredPlanecolumn is set to the chosen value ("1"or"2"), and the reviewer name andreviewedflag 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 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 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cmt_solutions-0.0.0.tar.gz | 3.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cmt_solutions-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.1 MB
Release files / cmt_solutions-0.0.0.tar.gz
| Download URL | cmt_solutions-0.0.0.tar.gz |
|---|---|
| Size | 3.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bba8930c67e1843b0e23a99b6c6133f688fb9ec0a601720cd32b60f7905e2be
|
|
BLAKE2b-256 checksum How to use checksums |
47a87a03d50e3e6b17d0bca2e3e6ceb285f8a98efd9c3580ea1e3b93487f7db7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / cmt_solutions-0.0.0-py3-none-any.whl
| Download URL | cmt_solutions-0.0.0-py3-none-any.whl |
|---|---|
| Size | 2.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b9b3ef77ca41f31792ea9f74fd19e7a55a7a080775982a123f815abae048641
|
|
BLAKE2b-256 checksum How to use checksums |
ad57555913ffe62df2c97edb3e9409dd0be10328eca43c9601ed4e3e5ac92eba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency log