pycsamt.interp.borehole#
Borehole — ground-truth data model for EM geological interpretation.
A Borehole stores the depth-interval log collected during or
after drilling operations. Intervals carry the true resistivity
(TRES) measured in the lab or from downhole logging, and a lithology
name. Both are used by ModelCalibrator
to constrain 2-D inversion models.
Supported input formats#
CSV — single file with columns
top, bottom, lithology[, resistivity]LAS 2.0 — industry well-log ASCII standard
dict / list — programmatic construction
Example
>>> bh = Borehole.from_csv("K1_borehole.csv", name="Bo", x=1050.0)
>>> bh.tres_at_depth(95.0)
180.0
Classes
- class pycsamt.interp.borehole.Interval(top, bottom, lithology, resistivity=None)[source]#
Bases:
objectA single depth interval in a borehole log.
- Parameters:
top (float) – Depth to the top of the interval, metres.
bottom (float) – Depth to the bottom of the interval, metres.
lithology (str) – Geological formation / lithology name.
resistivity (float or None) – True resistivity (TRES) in Ω·m (linear, not log₁₀).
Nonewhen no electrical measurement is available.
- class pycsamt.interp.borehole.Borehole(name, x, intervals, *, collar_elevation=0.0)[source]#
Bases:
objectBorehole / well log with depth-interval data.
- Parameters:
name (str) – Well / borehole identifier.
x (float) – Position along the survey profile, metres.
collar_elevation (float) – Surface elevation at the borehole collar, metres a.s.l. Used only when elevation-corrected exports are requested.
intervals (list of Interval) – Depth-interval log, sorted ascending by top.
- tres_column(z_centers)[source]#
Return TRES values at z_centers as a float array.
Depths not covered by any interval are
nan.
- classmethod from_csv(path, *, name=None, x=0.0, collar_elevation=0.0, delimiter=',', top_col='top', bottom_col='bottom', lithology_col='lithology', resistivity_col='resistivity')[source]#
Load from a CSV file.
Expected columns (case-insensitive header):
top, bottom, lithology[, resistivity]- Parameters:
path (path-like)
name (str, optional) – Defaults to the file stem.
x (float) – Profile position.
collar_elevation (float)
delimiter (str)
top_col (str) – Column header names.
bottom_col (str) – Column header names.
lithology_col (str) – Column header names.
resistivity_col (str) – Column header names.
- Return type:
- classmethod from_las(path, *, x=0.0, collar_elevation=0.0, depth_curve='DEPT', resistivity_curve='RESD', lithology_curve='LITH', null_value=-9999.25, step=None)[source]#
Load from a LAS 2.0 well-log file.
Converts the continuous depth log into discrete intervals by grouping consecutive samples with the same lithology code.
- Parameters:
path (path-like)
x (float) – Profile position.
depth_curve (str) – Curve mnemonics. lithology_curve may be
Noneto assign a generic label.resistivity_curve (str) – Curve mnemonics. lithology_curve may be
Noneto assign a generic label.lithology_curve (str | None) – Curve mnemonics. lithology_curve may be
Noneto assign a generic label.null_value (float) – LAS null sentinel replaced with
nan.step (float, optional) – If provided, override the step value from the LAS header.
collar_elevation (float)
- Return type:
- to_dataframe()[source]#
Return intervals as a
pandas.DataFrame.