Metadata-Version: 2.3
Name: lithovox-tools
Version: 0.1.0
Summary: CPT interpretation tools for LithoVox: Lengkeek & Brinkgreve (2022) soil classification of Dutch (organic) soils
Keywords: cpt,gef,geotechniek,soil-classification,lengkeek,robertson
Author: LithoVox
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Requires-Dist: brodata>=0.1.10
Requires-Dist: pygef>=0.14
Requires-Dist: matplotlib>=3.8 ; extra == 'plot'
Requires-Python: >=3.12
Project-URL: Homepage, https://www.lithovox.com
Provides-Extra: plot
Description-Content-Type: text/markdown

# lithovox-tools

CPT interpretation for LithoVox: read a CPT (GEF or BRO XML) and classify its samples
with Lengkeek & Brinkgreve (2022), the refinement of Robertson's (2010) chart that splits
his zone 2 into peat (2a), organic clay (2b) and clay with organic matter (2c).

```python
from lithovox_tools import read_cpt
from lithovox_tools.cpt import Lengkeek

interpretation = Lengkeek(read_cpt("cpt.gef")) # or Lengkeek.from_gef("cpt.gef")
for layer in interpretation.layers:
    print(f"{layer.top:7.2f} {layer.bottom:7.2f}  {layer.zone.label}")
interpretation.plot("cpt.png")
```

![The CPT as a log: qc, fs and Rf beside the soil column](docs/cpt.png)

*`interpretation.plot()` of the BRO CPT in `tests/data` (`CPT000000251174`, 712 samples,
19 layers): qc in black, fs in blue, Rf in red, and the soil behaviour type column in the
zones' colours — peat (2a) between 6 and 8 m deep.*

## The method

    Isbt = sqrt((3.47 - log10(qt / pa))^2 + (log10(Rf) + 1.22)^2)

A sample below an organic zone's curve lies in that zone (Eq. 1, Table 4):

    qt/pa = a * (Rf - Rf,min)^b

    peat                      a = 8.0  b = 0.50  Rf,min = 5.2 %
    organic clay              a = 5.2  b = 0.62  Rf,min = 2.3 %
    clay with organic matter  a = 4.7  b = 0.64  Rf,min = 0.60 %

No stress normalisation, on purpose (the paper, 3.1). Layers thinner than `MIN_LAYER`
merge into their thicker neighbour, then neighbours of the same zone into one. The same
method as the desktop app (`lithovox-modelling/src/robertson.rs`).

## Literature

- Lengkeek, H.J. & Brinkgreve, R.B.J. (2022), *CPT-based classification of soft organic
  clays and peat*:
  [researchgate.net/publication/361159159](https://www.researchgate.net/publication/361159159_CPT-based_classification_of_soft_organic_clays_and_peat)

## Modules

- [`lithovox_tools.cpt`](src/lithovox_tools/cpt/lengkeek.py): `Lengkeek(cpt).samples`,
  `.layers`, `.zone(q, rf, isbt)` and `.plot(path=None)`, plus `Zone` and `Layer`.
- [`lithovox_tools.gef`](src/lithovox_tools/gef.py): GEF files, with
  [pygef](https://github.com/cemsbv/pygef).
- [`lithovox_tools.bro`](src/lithovox_tools/bro.py): BRO CPT XML (dscpt 1.1), with
  [brodata](https://github.com/ArtesiaWater/brodata) — a file or a BRO URL, its metadata
  and its measurements as a pandas DataFrame.
- [`lithovox_tools.read_cpt()`](src/lithovox_tools/reader.py): either, sniffed.

## Install and test

    uv sync --extra plot   # the plot needs matplotlib
    uv run pytest
