read_capillary_pressure

petrophys.interpretation.saturation.height.read_capillary_pressure

read_capillary_pressure(
source,
*,
sample=None,
pc=None,
sw=None,
porosity=None,
permeability=None,
depth=None,
system='air_mercury',
ift=None,
theta=None,
pc_unit=None,
saturation=None,
sheet_name=0,
)[source]

Read plug capillary-pressure curves from a CSV or Excel table (or a DataFrame).

One row per measured point: the plug (sample), the capillary pressure (pc), the saturation (sw), and the plug’s porosity, permeability (mD) and, optionally, depth. Columns are found by their names, with any unit in brackets ignored (Plug No., Injection Pressure (psia), Helium Porosity (%), Klinkenberg Perm (mD) …), unless named. Porosity and saturation in percent become v/v.

pc_unit is the pressure unit (psi, kPa, MPa, bar, atm); by default the unit in the header, in brackets (Pc (kPa)) or as its last word (Pc_kPa, PC_BAR), else psi. saturation is "wetting" (Sw) or "nonwetting" (mercury saturation, converted to Sw = 1 - SHg); by default a header naming mercury (Hg Saturation) is non-wetting. A saturation that rises with pressure in most plugs is not Sw, and is refused with a pointer to the other saturation setting. system names the laboratory fluids, which set the interfacial tension and contact angle (ift, theta override them). sheet_name is the sheet of an Excel workbook (default: the first).

A plug named on its first row only (merged cells in a spreadsheet) owns the rows down to the next plug, and those rows take its porosity, permeability and depth where theirs are blank. Rows without a number for Pc, saturation, porosity or permeability are dropped.

A named column that is absent, or a required column that cannot be found, raises KeyError; an unknown system, pc_unit or saturation, or a table with no usable row, raises ValueError.

Parameters:
  • source (Union[str, Path, 'pd.DataFrame'])

  • sample (Optional[str])

  • pc (Optional[str])

  • sw (Optional[str])

  • porosity (Optional[str])

  • permeability (Optional[str])

  • depth (Optional[str])

  • system (str)

  • ift (Optional[float])

  • theta (Optional[float])

  • pc_unit (Optional[str])

  • saturation (Optional[str])

  • sheet_name (Any)

Return type:

CapillaryPressureData