CoreImageData¶
petrophys.interpretation.core_analysis.CoreImageData
- class CoreImageData(
- depth,
- grey_level=None,
- grey_std=None,
- r=None,
- g=None,
- b=None,
- hue=None,
- saturation=None,
- value=None,
- metadata=<factory>,
Color measurements extracted from core slab photographs.
- Parameters:
depth (np.ndarray) – Measured depth (m or ft).
grey_level (np.ndarray, optional) – Average grey level (0–255 or 0–1).
grey_std (np.ndarray, optional) – Standard deviation of grey level (texture proxy).
r (np.ndarray, optional) – Red channel (0–255).
g (np.ndarray, optional) – Green channel (0–255).
b (np.ndarray, optional) – Blue channel (0–255).
hue (np.ndarray, optional) – Hue (0–360°).
saturation (np.ndarray, optional) – Saturation (0–1).
value (np.ndarray, optional) – Value/brightness in HSV (0–1).
metadata (dict)
Examples
>>> img = CoreImageData.from_las("core_image.las") >>> bi = img.brightness_index() >>> ci = img.color_index()
Attributes
Methods
Brightness index scaled to [0, 1].
Color index: the HSV saturation, or (max - min) / max of RGB.
Return a new CoreImageData filtered to [top, bottom].
Create CoreImageData from a pandas DataFrame.
Load color data from a LAS file.
Simple rule-based lithology classification from color.
Convert RGB (0–255) to HSV.
Texture index from grey level standard deviation.
Export all loaded channels to a pandas DataFrame.
- classmethod from_las(
- filepath,
- grey_mnemonic='E_MBWP',
- grey_std_mnemonic='E_STDP',
- r_mnemonic='E_MRPX',
- g_mnemonic='E_MGPX',
- b_mnemonic='E_MBPX',
- hue_mnemonic='E_MHPX',
- sat_mnemonic='E_MSPX',
- val_mnemonic='E_MVPX',
- null_value=-999.25,
Load color data from a LAS file.
Defaults match the EpsLog/Stratum Reservoir
Image_10.0mm_WL.lasmnemonic convention (E_MBWP,E_MRPX, etc.).EpsLog stores RGB, grey level, saturation, and value on a 0–255 scale and hue in degrees (0–360). This loader normalises saturation and value to 0–1 automatically when their stored maximum exceeds 1.5, so that
color_index()andlithology_from_color()work correctly regardless of source scale.Depth is read via
lasio’slas.indexproperty (always the first column, regardless of mnemonic name).- Parameters:
filepath (str or Path)
grey_mnemonic (str, optional) – Average grey level mnemonic (EpsLog:
E_MBWP).grey_std_mnemonic (str, optional) – Grey level standard deviation (EpsLog:
E_STDP).r_mnemonic (str, optional) – RGB channel mnemonics (EpsLog:
E_MRPX,E_MGPX,E_MBPX).g_mnemonic (str, optional) – RGB channel mnemonics (EpsLog:
E_MRPX,E_MGPX,E_MBPX).b_mnemonic (str, optional) – RGB channel mnemonics (EpsLog:
E_MRPX,E_MGPX,E_MBPX).hue_mnemonic (str, optional) – HSV channel mnemonics (EpsLog:
E_MHPX,E_MSPX,E_MVPX). Hue is kept in degrees; saturation and value are normalised to 0–1.sat_mnemonic (str, optional) – HSV channel mnemonics (EpsLog:
E_MHPX,E_MSPX,E_MVPX). Hue is kept in degrees; saturation and value are normalised to 0–1.val_mnemonic (str, optional) – HSV channel mnemonics (EpsLog:
E_MHPX,E_MSPX,E_MVPX). Hue is kept in degrees; saturation and value are normalised to 0–1.null_value (float)
- Return type:
- classmethod from_dataframe(
- df,
- depth_col='DEPTH',
- grey_col=None,
- grey_std_col=None,
- r_col=None,
- g_col=None,
- b_col=None,
- hue_col=None,
- sat_col=None,
- val_col=None,
Create CoreImageData from a pandas DataFrame.
- brightness_index()[source]¶
Brightness index scaled to [0, 1].
Uses grey_level if available, otherwise derives from RGB mean, or falls back to the HSV value channel. Grey level and RGB are divided by their maximum in the data, so 1 is the brightest sample loaded, not absolute white.
- Returns:
Low = dark (organic-rich), high = light (clean carbonate/evaporite).
- Return type:
np.ndarray
- color_index()[source]¶
Color index: the HSV saturation, or (max - min) / max of RGB.
Highlights color-rich intervals (iron staining, chlorite, etc.) against grey/white intervals. Returns 0 for grey, 1 for maximum color.
- Returns:
Higher values = more colorful / chromatic.
- Return type:
np.ndarray
- texture_index()[source]¶
Texture index from grey level standard deviation.
Higher values indicate heterogeneous textures (lamination, bioturbation, vugs). Returns NaN if grey_std is not available.
- Return type:
- lithology_from_color()[source]¶
Simple rule-based lithology classification from color.
- Returns:
One of: “dark_organic”, “red_iron”, “tan_sand”, “grey_carbonate”, “green_chlorite”, “unclassified”.
- Return type:
np.ndarray of str