BoreholeImageData

petrophys.interpretation.borehole_imaging.BoreholeImageData

class BoreholeImageData(
depth,
image,
channel_names,
samples_per_channel,
image_type='dynamic',
depth_unit='m',
value_unit='',
metadata=<factory>,
)[source]

Borehole image log data.

Parameters:
  • depth (np.ndarray) – Measured depth array.

  • image (np.ndarray) – 2D image data with shape (n_depth, n_borehole_samples).

  • channel_names (list of str) – DLIS/LAS channels concatenated into the image, in left-to-right order.

  • samples_per_channel (list of int) – Number of button/samples contributed by each channel.

  • image_type (str) – Image style, for example "dynamic" or "static".

  • depth_unit (str) – Depth unit.

  • value_unit (str) – Image value unit, often blank for processed FMI dynamic image values.

  • metadata (dict) – Source and frame metadata.

Attributes

Methods

filter_by_depth

Return the image rows within a depth interval.

from_arrays

Build image data from a depth array and a 2D image array.

from_dlis

Load a borehole image frame from DLIS.

from_las

Reconstruct a borehole image from flattened LAS button curves.

from_well

Reconstruct a borehole image from flattened curves in a Well.

normalized_image

Return image values scaled to 0-1 for display.

per_depth_statistics

Return image mean, min, max, standard deviation, and coverage.

plot

Plot the borehole image with depth increasing downward.

to_well_curves

Add scalar image-summary curves to a Well.

depth: ndarray
image: ndarray
channel_names: list[str]
samples_per_channel: list[int]
image_type: str = 'dynamic'
depth_unit: str = 'm'
value_unit: str = ''
metadata: dict[str, Any]
property n_samples: int
property n_borehole_samples: int
property top: float | None
property bottom: float | None
classmethod from_arrays(
depth,
image,
channel_names=None,
samples_per_channel=None,
image_type='dynamic',
depth_unit='m',
value_unit='',
metadata=None,
)[source]

Build image data from a depth array and a 2D image array.

Parameters:
  • depth (array) – Depth of each image row.

  • image (array) – Image values with shape (n_depth, n_borehole_samples).

  • channel_names (sequence of str, optional) – Channels that make up the image, in left-to-right order; one channel named IMAGE by default.

  • samples_per_channel (sequence of int, optional) – Number of image columns of each channel; by default the whole image width for the one channel.

  • image_type (str, default "dynamic") – Image style, for example "dynamic" or "static".

  • depth_unit (str, default "m") – Unit of depth.

  • value_unit (str, default "") – Unit of the image values.

  • metadata (dict, optional) – Source and frame metadata; copied.

Returns:

The image data.

Return type:

BoreholeImageData

Raises:

ValueError – If image is not 2D, its first dimension differs from the length of depth, channel_names and samples_per_channel differ in length, or the sample counts do not sum to the image width.

classmethod from_dlis(
filepath,
frame_name=None,
image_channels=None,
logical_file=0,
image_type='dynamic',
null_value=-999.25,
normalize=False,
)[source]

Load a borehole image frame from DLIS.

By default, this detects common FMI processed image channels (FMPA/FMFA/.../FMFD). If those are absent, it uses channels whose DLIS dimensions indicate more than one per-depth sample.

Parameters:
Return type:

BoreholeImageData

classmethod from_las(
filepath,
channel_prefixes=None,
image_type='dynamic',
null_value=None,
normalize=False,
)[source]

Reconstruct a borehole image from flattened LAS button curves.

LAS cannot natively preserve DLIS-style array channels, so FMI images are commonly exported as curves such as FMPA_0 … FMPA_23. This loader groups those numbered curves back into a 2D image.

Parameters:
Return type:

BoreholeImageData

classmethod from_well(
well,
channel_prefixes=None,
image_type='dynamic',
normalize=False,
)[source]

Reconstruct a borehole image from flattened curves in a Well.

Parameters:
  • well (Well)

  • channel_prefixes (Optional[Sequence[str]])

  • image_type (str)

  • normalize (bool)

Return type:

BoreholeImageData

filter_by_depth(top, bottom)[source]

Return the image rows within a depth interval.

Parameters:
  • top (float) – Limits of the interval, in depth_unit, in either order; rows at the limits are kept.

  • bottom (float) – Limits of the interval, in depth_unit, in either order; rows at the limits are kept.

Returns:

Image data holding the rows inside the interval, with the same channels, units and metadata.

Return type:

BoreholeImageData

normalized_image()[source]

Return image values scaled to 0-1 for display.

Return type:

ndarray

per_depth_statistics()[source]

Return image mean, min, max, standard deviation, and coverage.

Return type:

dict[str, ndarray]

to_well_curves(well=None, prefix='IMG')[source]

Add scalar image-summary curves to a Well.

This is intentionally lossy and meant for QC/workflow integration. The original image stays in BoreholeImageData.image.

Parameters:
  • well (Optional['Well'])

  • prefix (str)

Return type:

Well

plot(depth_range=None, ax=None, cmap='gray', normalize=True)[source]

Plot the borehole image with depth increasing downward.

Parameters:
Return type:

Any