Welcome to APSG’s documentation!#
APSG brings the essential analytical toolkit of structural geology directly into Python. From processing raw field measurements and performing directional statistics to simplified stress and strain tensor analysis and creating publication-ready stereonets and fabric diagrams, APSG handles the underlying mathematics while keeping every step transparent, documented, and reproducible. It provides an intuitive pythonic bridge between field observations, quantitative analysis, and tectonic interpretation — all seamlessly integrated into your Jupyter notebook.
Lineations, foliations, faults, pairs, cones and arcs behave like proper geological objects, with degree-based angles and RHR/dip-direction notation built in.
Group any feature into a set for vectorized statistics, filtering, rotation and resampling — no manual loops over measurements.
Deformation gradients, orientation and stress tensors, with Vollmer, Ramsay, Flinn and Hsu fabric plots ready to go.
Publication-ready equal-area/equal-angle stereonets, contouring and rose diagrams, styled through a single configuration object.
APSG features live directly inside a DataFrame column via a
pandas extension type, so your existing pandas workflow just works.
Read and write field data from legacy PySDB .sdb files or a
remote websdb project with the same feature-based API.
Usage#
To use APSG in a project:
import apsg
To use APSG interactively it is easier to import into current namespace:
from apsg import *
Check tutorials and module API for more details.