Геологическая практика — field data, visualisation, and ML tools for MSU geology fieldwork (Crimea, 2025)
- Python 97.7%
- Nix 2.3%
- Rhythmogram plotting with rock-type legend - Pie chart diagrams for grain size/composition/roundness - Markdown table utilities (renumber, sort by age/purpose) - Gemma 4 E4B fine-tuning pipeline for OCR on field forms - 140+ field sample photos (gitignored) - Data files: rhythm layers, legends, 155-entry sample catalogue |
||
|---|---|---|
| .obsidian | ||
| data | ||
| scripts | ||
| training | ||
| .gitignore | ||
| .python-version | ||
| devenv.lock | ||
| devenv.nix | ||
| devenv.yaml | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
Геологическая практика — Geological Field Practice
Data processing, visualisation, and ML tools for MSU geology field practice (Crimea, 2025).
Structure
geol_prak/
├── data/ # Input data files
│ ├── rhythms.txt # Rhythm layer data (letter-number pairs)
│ ├── legend.txt # Rock type legend (letter → description)
│ └── table.md # Field sample catalogue (150+ entries)
│
├── scripts/ # Processing & visualisation scripts
│ ├── rhythmogram.py # ⭐ Rhythmogram plotter (CLI, coloured bars, legend)
│ ├── main.py # Early exploratory plot (hardcoded brigade data)
│ ├── diagrams.py # Pie chart diagrams (size, composition, roundness)
│ └── renumber_table.py # Markdown table renumbering utility
│
├── outputs/ # Generated figures
│ ├── rhythms.png
│ └── pie_charts.png
│
├── photos/ # Field sample photographs (140+ JPGs)
│
├── training/ # Gemma 4 E4B fine-tuning sub-project
│ ├── train.py # JAX/Kauldron training script
│ ├── infer.py # Inference on new form images
│ ├── data_pipeline.py # Grain data pipeline
│ ├── prepare_data.py # CSV → JSONL conversion
│ └── README.md # Full training documentation
│
├── pyproject.toml # Python project config (marimo, matplotlib)
├── devenv.nix / devenv.yaml # Nix devenv configuration
├── uv.lock # Python dependency lock
└── .python-version # Python version pin
Quick start
# Enter the dev environment
devenv shell
# Generate a rhythmogram from data
python scripts/rhythmogram.py --file data/rhythms.txt --legend data/legend.txt
# Generate pie charts
python scripts/diagrams.py
# Renumber a markdown table
python scripts/renumber_table.py data/table.md
Scripts
| Script | Purpose |
|---|---|
scripts/rhythmogram.py |
Labeled horizontal bar plot of rhythm layers with colour-coded rock types and legend. Reads from file or stdin. |
scripts/main.py |
Older exploratory script with hardcoded brigade data (20, 21, 22). Plots cumulative thickness vs rhythm index. |
scripts/diagrams.py |
2×3 pie chart grid showing grain size, composition, and roundness distribution for two datasets. |
scripts/renumber_table.py |
Utility to ensure N п/п column in markdown tables is sequentially numbered. Backs up original to /tmp. |
scripts/sort_specimens.py |
Sorts the sample table by purpose (stratigraphy → processes → magmatism) then by stratigraphic age (oldest → youngest). Reads from data/table.md, writes to a separate output file. |
Training
The training/ directory contains a JAX-based fine-tuning pipeline for
Gemma 4 E4B (multimodal) — teaching the model to OCR Russian-language
geological sample registration forms. See training/README.md for details.