CurveStandardizer

petrophys.preprocessing.standardization.CurveStandardizer

Also available as petrophys.preprocessing.CurveStandardizer

class CurveStandardizer(
rename_curves=True,
convert_units=True,
preserve_originals=False,
relabel_equivalent_units=True,
plausible_ranges=None,
)[source]

Standardizes curve mnemonics and units.

This class provides functionality to: - Map curve aliases to standard mnemonics - Convert units to standard units - Handle multiple variants of the same curve type

Parameters:
  • rename_curves (bool, optional) – Whether to rename curves to standard mnemonics (default: True)

  • convert_units (bool, optional) – Whether to convert to standard units (default: True)

  • preserve_originals (bool, optional) – Keep original curves with _ORIG suffix (default: False)

  • relabel_equivalent_units (bool, optional) – Write the standard unit label on a curve whose unit is another spelling of it, with a conversion factor of 1, e.g. gAPI for API (default: True). False leaves such labels as written.

  • plausible_ranges (dict, optional) – {standard mnemonic: (low, high)} limits of the implausible-value screening, in the standard units; default CURVE_PLAUSIBLE_RANGES.

Examples

>>> standardizer = CurveStandardizer()
>>> well = standardizer.standardize(well)

Attributes

relabel_equivalent_units

Rewrite a curve's unit label to the standard one even when the two are equivalent (conversion factor 1), e.g. m3/m3 to v/v.

Methods

add_alias

Add a custom alias mapping.

find_curve

Find a curve of specified type in well.

get_standard_name

Get the standard mnemonic for a curve.

report

Generate standardization report for a well.

standardize

Standardize all curves in a well.

standardize_curve

Standardize a single curve.

relabel_equivalent_units

Rewrite a curve’s unit label to the standard one even when the two are equivalent (conversion factor 1), e.g. m3/m3 to v/v. When False such labels are left as the source wrote them.

add_alias(standard, alias)[source]

Add a custom alias mapping.

Parameters:
  • standard (str) – Standard mnemonic

  • alias (str) – Alias to map to standard

get_standard_name(mnemonic)[source]

Get the standard mnemonic for a curve.

Parameters:

mnemonic (str) – Input mnemonic

Returns:

Standard mnemonic

Return type:

str

standardize(well)[source]

Standardize all curves in a well.

Parameters:

well (Well) – Well object to standardize

Returns:

Well with standardized curves

Return type:

Well

standardize_curve(curve, rename=None, convert=None)[source]

Standardize a single curve.

Parameters:
  • curve (Curve) – Curve to standardize

  • rename (bool, optional) – Override rename_curves setting

  • convert (bool, optional) – Override convert_units setting

Returns:

Standardized curve

Return type:

Curve

find_curve(well, curve_type)[source]

Find a curve of specified type in well.

Parameters:
  • well (Well) – Well to search

  • curve_type (str) – Standard curve type (e.g., “RDEP”, “RHOB”)

Returns:

Found curve, or None

Return type:

Curve or None

report(well)[source]

Generate standardization report for a well.

Parameters:

well (Well) – Well to analyze

Returns:

Report with standardization recommendations

Return type:

dict