TemperatureProfile

petrophys.interpretation.temperature.TemperatureProfile

class TemperatureProfile(
gradient=None,
surface_temp=DefaultParameters.SURFACE_TEMPERATURE_F,
temp_unit='F',
source='specified_gradient',
reference_temperature=None,
reference_depth=None,
)[source]

Formation temperature profile calculator.

Calculates formation temperature at depth using either: - Linear interpolation from BHT and surface temperature - Specified gradient - Two reference temperature points

Parameters:
  • gradient (float, optional) – Temperature gradient in °F/100ft

  • surface_temp (float, optional) – Surface temperature (default: 68°F)

  • temp_unit (str, optional) – Unit of surface_temp: “F”, “C”, “K” or a label such as “degC” (see petrophys.model.units.temperature_unit()); unknown labels raise ValueError

  • source (str, optional) – Label of how the gradient was obtained, reported with the result: "specified_gradient" (default), or the label the from_bht, two-point and fallback constructors set.

  • reference_temperature (float, optional) – Temperature the gradient was fitted to (degF), such as the BHT; reported with the result and not used in the calculation.

  • reference_depth (float, optional) – Depth of reference_temperature (ft); reported with the result.

Examples

>>> profile = TemperatureProfile(gradient=1.5, surface_temp=68)
>>> temp_at_depth = profile.get_temperature(5000)
>>> print(f"Temperature at 5000 ft: {temp_at_depth:.1f} °F")
Temperature at 5000 ft: 143.0 °F
>>> # From BHT
>>> profile = TemperatureProfile.from_bht(bht=200, td=10000)
>>> temps = profile.calculate(depth_array)

Attributes

gradient

Return temperature gradient in °F/100ft.

Methods

add_to_well

Add temperature curve to well.

calculate

Calculate temperature profile for depth array.

from_bht

Create temperature profile from BHT and TD.

from_gradient_c_per_km

Create a fallback geothermal profile from a C/km gradient.

from_two_points

Create temperature profile from two reference points.

get_temperature

Get formation temperature at specified depth(s).

property gradient: float | None

Return temperature gradient in °F/100ft.

classmethod from_bht(
bht,
td,
surface_temp=DefaultParameters.SURFACE_TEMPERATURE_F,
bht_unit='F',
depth_unit='ft',
surface_temp_unit=None,
)[source]

Create temperature profile from BHT and TD.

The profile is linear from surface_temp at depth 0 to bht at td: the BHT is taken as the static formation temperature (no correction for mud circulation, such as a Horner plot) and the surface temperature applies at depth 0, not at the seabed offshore.

Parameters:
  • bht (float) – Bottom hole temperature

  • td (float) – Total depth

  • surface_temp (float, optional) – Surface temperature, in surface_temp_unit

  • bht_unit (str, optional) – BHT unit: “F”, “C”, “K” or a label such as “degC”; unknown labels raise ValueError

  • depth_unit (str, optional) – Depth unit

  • surface_temp_unit (str, optional) – Unit of surface_temp. Default: degF for the default 68, otherwise bht_unit.

Returns:

Configured temperature profile

Return type:

TemperatureProfile

classmethod from_gradient_c_per_km(
gradient_c_per_km=DefaultParameters.GEOTHERMAL_GRADIENT_C_PER_KM,
surface_temp=DefaultParameters.SURFACE_TEMPERATURE_C,
surface_temp_unit='C',
)[source]

Create a fallback geothermal profile from a C/km gradient.

Parameters:
  • gradient_c_per_km (float)

  • surface_temp (float)

  • surface_temp_unit (str)

Return type:

TemperatureProfile

classmethod from_two_points(
temp1,
depth1,
temp2,
depth2,
temp_unit='F',
depth_unit='ft',
)[source]

Create temperature profile from two reference points.

Any two temperature values at known depths can be used to calculate the gradient.

Parameters:
  • temp1 (float) – First temperature

  • depth1 (float) – First depth

  • temp2 (float) – Second temperature

  • depth2 (float) – Second depth

  • temp_unit (str, optional) – Temperature unit: “F”, “C”, “K” or a label such as “degC”; unknown labels raise ValueError

  • depth_unit (str, optional) – Depth unit

Returns:

Configured temperature profile

Return type:

TemperatureProfile

get_temperature(depth, depth_unit='ft')[source]

Get formation temperature at specified depth(s).

Parameters:
  • depth (float or np.ndarray) – Depth value(s)

  • depth_unit (str, optional) – Depth unit

Returns:

Temperature in °F

Return type:

float or np.ndarray

calculate(depth, depth_unit='ft')[source]

Calculate temperature profile for depth array.

Parameters:
  • depth (np.ndarray) – Depth values

  • depth_unit (str, optional) – Depth unit

Returns:

Temperature profile results

Return type:

TemperatureResult

add_to_well(well, curve_name='TEMP')[source]

Add temperature curve to well.

Parameters:
  • well (Well) – Well object

  • curve_name (str, optional) – Name for temperature curve

Returns:

Well with temperature curve added

Return type:

Well