Welcome to APSG¶
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.
-
Structural features
Lineations, foliations, faults, pairs, cones and arcs behave like proper geological objects, with degree-based angles and RHR/dip-direction notation built in.
-
Feature sets
Group any feature into a set for vectorized statistics, filtering, rotation and resampling — no manual loops over measurements.
-
Tensors & fabric analysis
Deformation gradients, orientation and stress tensors, with Vollmer, Ramsay, Flinn and Hsu fabric plots ready to go.
-
Stereonets & rose diagrams
Publication-ready equal-area/equal-angle stereonets, contouring and rose diagrams, styled through a single configuration object.
-
Pandas integration
APSG features live directly inside a
DataFramecolumn via a pandas extension type, so your existing pandas workflow just works. -
Database support
Read and write field data from legacy PySDB
.sdbfiles or a remote websdb project with the same feature-based API.
Usage¶
To use APSG in a project:
To use APSG interactively it is easier to import into current namespace:
A quick stereonet of random Fisher-distributed foliations: