shift_core_depths

petrophys.interpretation.core_analysis.shift_core_depths

shift_core_depths(core, shift)[source]

Return a copy of core with every plug depth moved by shift.

Parameters:
  • core (CoreData) – Core plugs to shift. The input is not modified.

  • shift (float, array-like or CoreDepthShift) – Shift added to the plug depths, in well depth units (positive moves the plugs deeper). An array gives one shift per plug, for example a different shift for each core run. A CoreDepthShift applies its best shift.

Returns:

Shifted copy. metadata["depth_shift"] holds the total shift applied so far, so repeated shifts stay traceable.

Return type:

CoreData

Raises:

ValueError – If the shift is not finite or does not match the number of plugs.

Examples

>>> import numpy as np
>>> from petrophys.interpretation.core_analysis import CoreData
>>> core = CoreData(depth=np.array([2990.3, 2990.6]), porosity=np.array([0.21, 0.19]))
>>> moved = shift_core_depths(core, 2.9)
>>> moved.depth.round(1).tolist(), moved.metadata["depth_shift"]
([2993.2, 2993.5], 2.9)