2.16.3.2. pycsamt.geology.lithology#
Lithology — resistivity-to-geology classification for EM methods.
The built-in RockDatabase covers the resistivity ranges
encountered in MT, AMT, CSAMT, and CSEM surveys. Its entries live in
pycsamt.geology.rock_library (not in this module, so the table can
grow independently of the classification logic here), drawing on:
Palacky (1988) — resistivity of geological formations
Telford, Geldart & Sheriff (1990) — Applied Geophysics
Keller & Frischknecht (1966) — Electrical Methods in Geophysical Prospecting
Slichter & Telkes (1942) — electrical properties of minerals
Updated ranges for fracture zones, aquifers, and economic targets
StratigraphicLog packages a per-station depth profile with
lithology assignments and can be exported to CSV, LAS 2.0, or Oasis
Montaj XYZ format via pycsamt.interp.export.
Example
>>> db = RockDatabase.default()
>>> db.classify(250.0)
RockEntry(name='Granite (weathered)', rho_min=50, rho_max=2000, ...)
>>> log = StratigraphicLog.from_column(
... "S17", x=1050.0, z_centers=z, rho_log10=col, db=db
... )
Classes
|
One geological unit in a pseudo-stratigraphic log. |
|
Extensible rock physics database for EM resistivity interpretation. |
|
A single entry in the rock physics database. |
|
Per-station pseudo-stratigraphic depth profile. |
- class pycsamt.geology.lithology.RockEntry(name, rho_min, rho_max, color='#AAAAAA', description='', code=0, source='')[source]
Bases:
PyCSAMTObjectA single entry in the rock physics database.
- Parameters:
name (str) – Geological unit / lithology name.
rho_min (float) – Resistivity range in Ω·m (linear scale).
rho_max (float) – Resistivity range in Ω·m (linear scale).
color (str) – Hex colour code for plotting (e.g.
'#28B463').description (str) – Optional free-text note.
code (int) – Integer code used in LAS exports.
source (str) – Optional literature citation for this range (e.g.
'Palacky (1988)'). Empty when unspecified, as for entries loaded from a CSV without asourcecolumn.
- name: str
- rho_min: float
- rho_max: float
- color: str = '#AAAAAA'
- description: str = ''
- code: int = 0
- source: str = ''
- class pycsamt.geology.lithology.RockDatabase(entries, *, metadata=None)[source]
Bases:
PyCSAMTObject,MetadataMixinExtensible rock physics database for EM resistivity interpretation.
- Parameters:
Example
>>> db = RockDatabase.default() >>> db.classify(180.0).name 'Granite (weathered)'
- metadata: dict
- property entries: tuple[RockEntry, ...][source]
Read-only view of the database entries, in insertion order.
- classmethod default()[source]
Return a database pre-loaded with the built-in rock entries.
Entries come from
pycsamt.geology.rock_library.BUILTIN_ROCKS; see that module for the literature the ranges are drawn from.- Return type:
- classmethod from_csv(path)[source]
Load from a CSV file.
Required columns:
name, rho_min, rho_maxOptional columns:color, description, code, source- Parameters:
- Return type:
- classmethod from_provider(provider)[source]
Build a database from any
RockPropertyProvider.This is the generic entry point behind
from_url(); call it directly when provider is something other than a plain URL fetch, such as a provider pre-configured with authentication or a provider composing several sources.- Parameters:
provider (RockPropertyProvider)
- Return type:
- classmethod from_url(url, *, cache_dir=None, ttl_seconds=86400.0, timeout=10.0, force=False, fallback=True)[source]
Fetch a database from url, with local caching and fallback.
url must serve a JSON array of objects using the same fields as
RockEntry(name,rho_min,rho_max, and optionallycolor,description,code,source). No public rock-resistivity service is bundled or assumed by default – point this at a project- or organisation-controlled endpoint (an internal API, a shared JSON file on a file server, and so on).- Parameters:
url (str) – Location to fetch the JSON entry list from.
cache_dir (path-like, optional) – Override the local cache location. Defaults to
$PYCSAMT_ROCKDB_CACHEor~/.pycsamt/rock_db.ttl_seconds (float) – Reuse a cached response younger than this many seconds instead of re-fetching. Default one day.
timeout (float) – Network timeout in seconds for the fetch itself.
force (bool) – Re-fetch even if a fresh cache entry exists.
fallback (bool) – If the fetch fails (network, timeout, malformed response) and no usable cache entry exists, fall back to
default()instead of raising. Set toFalseto surface the failure instead.
- Return type:
See also
pycsamt.geology.rock_providers.RemoteRockPropertyProviderThe provider implementing the fetch/cache/fallback policy used here.
- classify(rho_ohm_m, method='nearest')[source]
Return the best-matching rock entry for rho_ohm_m.
- class pycsamt.geology.lithology.Layer(top, bottom, rho_log10, lithology, color='#AAAAAA', confidence=1.0)[source]
Bases:
PyCSAMTObjectOne geological unit in a pseudo-stratigraphic log.
- Parameters:
top (float) – Depth in metres (positive downward).
bottom (float) – Depth in metres (positive downward).
rho_log10 (float) – Representative \(\log_{10}(\rho)\) of the layer.
lithology (str) – Rock name from
RockDatabase.color (str) – Hex colour for plotting.
confidence (float) – Fraction of depth cells whose DB classification matches the reported lithology (0 – 1).
- top: float
- bottom: float
- rho_log10: float
- lithology: str
- color: str = '#AAAAAA'
- confidence: float = 1.0
- class pycsamt.geology.lithology.StratigraphicLog(station_name, station_x, z_centers, rho_log10, layers)[source]
Bases:
PyCSAMTObjectPer-station pseudo-stratigraphic depth profile.
Constructed from a 1-D log10-rho column and a
RockDatabase, it merges adjacent cells that share the same lithology into discreteLayerobjects.- Parameters:
- classmethod from_column(station_name, x, z_centers, rho_log10, db=None, *, merge_tolerance=0.2)[source]
Build a log from a 1-D resistivity column.
- Parameters:
- Return type:
- to_dataframe()[source]
Return layers as a
pandas.DataFrame.