read_formations¶
petrophys.io.read_formations
Also available as petrophys.read_formations
- read_formations(
- source,
- *,
- columns=None,
- well_name=None,
- well=None,
- depth_unit=None,
- depth_reference=None,
- datum=None,
- sheet_name=None,
- sep=None,
- encoding='utf-8-sig',
- rank=None,
Read formation picks or bounded intervals into one canonical table.
Required columns are
formation_name,top_depth;bottom_depthis optional and is never invented. CSV/TSV/Excel, DataFrames, FormationTops, interval lists, name/depth mappings and pairs are supported.columnsmaps canonical names to source headers. Multiwell inputs require selection. Rank, parent, age and lithology are preserved. Depth metadata and a structured import report are stored inDataFrame.attrs. Withwell, compatible length units are converted; incompatible reference/datum joins are rejected.rank(e.g."formation") keeps one stratigraphic level of a hierarchical table; NPD-style names (“Etive Fm.”) carry their rank.- Returns:
One row per formation, sorted by
top_depth:formation_name,top_depthand those ofbottom_depth,lithology,age,rank,parent,well,depth_unit,depth_referenceanddatumthe source gives. Depths are numbers in the source’s unit, or in the depth unit ofwellwhen it is given.DataFrame.attrsholdsdepth_unit,depth_reference,datumandimport_report.- Return type:
DataFrame
- Raises:
FileNotFoundError – If a source file does not exist.
ValueError – If a required column is missing, a depth is not a finite number, a top is not above its bottom, a table of several wells is given without
well_nameorwell, no row matches the well orrank, or the depth reference or datum does not match the well’s.