Rock

class Rock(*args, **kwargs)[source]

Rock component of geological model.

add_to_attribute(attr, addition, box)

Add a constant to an attribute.

Parameters:
  • attr (str) – Attribute to be modfied.

  • addition (float) – Addition.

  • box (Sequence[int, int, int, int, int, int]) – (i1, i2, j1, j2, k1, k2) - Box in which a constant should be added to an attribute (attr[i1:i2, j1:j2, k1:k2]) = attr[i1:i2, j1:j2, k1:k2] + addition).

Returns:

self

Return type:

self.__class__

affine_transform(func, attr, *args, inplace=False, **kwargs)

Compute affine_transform for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.affine_transform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.affine_transform.

Returns:

output – Transformed component.

Return type:

SpatialComponent

apply(func, attr, *args, inplace=False, **kwargs)

Apply function to attributes.

Parameters:
  • func (callable) – A function to apply. Must accept data as its first argument.

  • attr (str, array-like) – Attributes to get data from.

  • args (misc) – Any additional positional arguments to func.

  • kwargs (misc) – Any additional named arguments to func.

Returns:

output – Transformed component.

Return type:

BaseComponent

property attributes

Array of attributes.

binary_closing(func, attr, *args, inplace=False, **kwargs)

Compute binary_closing for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_closing.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_closing.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_dilation(func, attr, *args, inplace=False, **kwargs)

Compute binary_dilation for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_dilation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_dilation.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_erosion(func, attr, *args, inplace=False, **kwargs)

Compute binary_erosion for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_erosion.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_erosion.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_fill_holes(func, attr, *args, inplace=False, **kwargs)

Compute binary_fill_holes for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_fill_holes.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_fill_holes.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_hit_or_miss(func, attr, *args, inplace=False, **kwargs)

Compute binary_hit_or_miss for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_hit_or_miss.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_hit_or_miss.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_opening(func, attr, *args, inplace=False, **kwargs)

Compute binary_opening for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_opening.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_opening.

Returns:

output – Transformed component.

Return type:

SpatialComponent

binary_propagation(func, attr, *args, inplace=False, **kwargs)

Compute binary_propagation for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.binary_propagation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.binary_propagation.

Returns:

output – Transformed component.

Return type:

SpatialComponent

black_tophat(func, attr, *args, inplace=False, **kwargs)

Compute black_tophat for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.black_tophat.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.black_tophat.

Returns:

output – Transformed component.

Return type:

SpatialComponent

center_of_mass(func, attr, *args, inplace=False, **kwargs)

Compute center_of_mass for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.center_of_mass.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.center_of_mass.

Returns:

output – Transformed component.

Return type:

SpatialComponent

property class_name

Name of the component.

clip(func, attr, *args, inplace=False, **kwargs)

Compute array of cliped values for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.clip.

  • kwargs (misc) – Any additional named arguments to numpy.clip.

Returns:

output – Transformed component.

Return type:

SpatialComponent

convolve(func, attr, *args, inplace=False, **kwargs)

Compute convolve for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.convolve.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.convolve.

Returns:

output – Transformed component.

Return type:

SpatialComponent

convolve1d(func, attr, *args, inplace=False, **kwargs)

Compute convolve1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.convolve1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.convolve1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

copy()

Returns a deepcopy of attributes. Cached properties are not copied.

copy_attribute(attr1, attr2, box=None)

Copy attribute values to another atribute.

Parameters:
  • attr1 (str) – Attribute to be copied.

  • attr2 (str) – Destination attribute

  • box (Sequence[int, int, int, int, int, int] or None, optional) – (i1, i2, j1, j2, k1, k2) - Box in which attribute values should be copied (attr2[i1:i2, j1:j2, k1:k2]) = attr1[i1:i2, j1:j2, k1:k2]), by default None.

Returns:

self

Return type:

self.__class__

correlate(func, attr, *args, inplace=False, **kwargs)

Compute correlate for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.correlate.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.correlate.

Returns:

output – Transformed component.

Return type:

SpatialComponent

correlate1d(func, attr, *args, inplace=False, **kwargs)

Compute correlate1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.correlate1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.correlate1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

crop(func, attr, *args, inplace=False, **kwargs)

Compute cropped array by crop_width along each dimension for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to crop.

  • kwargs (misc) – Any additional named arguments to crop.

Returns:

output – Transformed component.

Return type:

SpatialComponent

del_state(*args)

State remover.

distance_transform_bf(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_bf for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_bf.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_bf.

Returns:

output – Transformed component.

Return type:

SpatialComponent

distance_transform_cdt(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_cdt for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_cdt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_cdt.

Returns:

output – Transformed component.

Return type:

SpatialComponent

distance_transform_edt(func, attr, *args, inplace=False, **kwargs)

Compute distance_transform_edt for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.distance_transform_edt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.distance_transform_edt.

Returns:

output – Transformed component.

Return type:

SpatialComponent

drop(attr)

Drop an attribute.

dump(path, **kwargs)

Dump attributes into file.

Parameters:
  • path (str) – Path to output file.

  • kwargs (dict, optional) – Any kwargs for dump method.

Returns:

comp – BaseComponent unchanged.

Return type:

BaseComponent

static dump_array_ascii(buffer, array, header=None, fmt='%f', compressed=True)

Writes array-like data into an ASCII buffer.

Parameters:
  • buffer (buffer-like)

  • array (1d, array-like) – Array to be saved

  • header (str, optional) – String to be written line before the array

  • fmt (str or sequence of strs, optional) – Format to be passed into numpy.savetxt function. Default to ‘%f’.

  • compressed (bool) – If True, uses compressed typing style

property empty

True if component is empty else False.

empty_like()

Get an empty component with the same state and the structure of embedded BaseComponents (if any).

equals_attribute(attr, val, box=None, dtype=None, create=False)

Set attribute values to a constant.

Parameters:
  • attr (str) – Attribute to be modified.

  • multiplier (float) – Multiplier.

  • box (Sequence[int, int, int, int, int, int]) – (i1, i2, j1, j2, k1, k2) - Box in which attribute values should be set to a constant (attr[i1:i2, j1:j2, k1:k2]) = val), by default None.

  • dtype (type) – Type of created array.

  • create (bool) – If create==True attribute is created, in case it does not exist.

Returns:

self

Return type:

self.__class__

extrema(func, attr, *args, inplace=False, **kwargs)

Compute extrema for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.extrema.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.extrema.

Returns:

output – Transformed component.

Return type:

SpatialComponent

property field

Field associated with the component.

find_objects(func, attr, *args, inplace=False, **kwargs)

Compute find_objects for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.find_objects.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.find_objects.

Returns:

output – Transformed component.

Return type:

SpatialComponent

flip(func, attr, *args, inplace=False, **kwargs)

Compute reversed order of elements in an array along the given axis for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.flip.

  • kwargs (misc) – Any additional named arguments to numpy.flip.

Returns:

output – Transformed component.

Return type:

SpatialComponent

fourier_ellipsoid(func, attr, *args, inplace=False, **kwargs)

Compute fourier_ellipsoid for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_ellipsoid.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_ellipsoid.

Returns:

output – Transformed component.

Return type:

SpatialComponent

fourier_gaussian(func, attr, *args, inplace=False, **kwargs)

Compute fourier_gaussian for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_gaussian.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_gaussian.

Returns:

output – Transformed component.

Return type:

SpatialComponent

fourier_shift(func, attr, *args, inplace=False, **kwargs)

Compute fourier_shift for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_shift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_shift.

Returns:

output – Transformed component.

Return type:

SpatialComponent

fourier_uniform(func, attr, *args, inplace=False, **kwargs)

Compute fourier_uniform for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.fourier_uniform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.fourier_uniform.

Returns:

output – Transformed component.

Return type:

SpatialComponent

gaussian_filter(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

gaussian_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

gaussian_gradient_magnitude(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_gradient_magnitude for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_gradient_magnitude.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_gradient_magnitude.

Returns:

output – Transformed component.

Return type:

SpatialComponent

gaussian_laplace(func, attr, *args, inplace=False, **kwargs)

Compute gaussian_laplace for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.gaussian_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.gaussian_laplace.

Returns:

output – Transformed component.

Return type:

SpatialComponent

generic_filter(func, attr, *args, inplace=False, **kwargs)

Compute generic_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

generic_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute generic_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

generic_gradient_magnitude(func, attr, *args, inplace=False, **kwargs)

Compute generic_gradient_magnitude for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_gradient_magnitude.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_gradient_magnitude.

Returns:

output – Transformed component.

Return type:

SpatialComponent

generic_laplace(func, attr, *args, inplace=False, **kwargs)

Compute generic_laplace for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.generic_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.generic_laplace.

Returns:

output – Transformed component.

Return type:

SpatialComponent

geometric_transform(func, attr, *args, inplace=False, **kwargs)

Compute geometric_transform for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.geometric_transform.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.geometric_transform.

Returns:

output – Transformed component.

Return type:

SpatialComponent

gradient(func, attr, *args, inplace=False, **kwargs)

Compute gradient for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.gradient.

  • kwargs (misc) – Any additional named arguments to numpy.gradient.

Returns:

output – Transformed component.

Return type:

SpatialComponent

grey_closing(func, attr, *args, inplace=False, **kwargs)

Compute grey_closing for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_closing.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_closing.

Returns:

output – Transformed component.

Return type:

SpatialComponent

grey_dilation(func, attr, *args, inplace=False, **kwargs)

Compute grey_dilation for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_dilation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_dilation.

Returns:

output – Transformed component.

Return type:

SpatialComponent

grey_erosion(func, attr, *args, inplace=False, **kwargs)

Compute grey_erosion for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_erosion.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_erosion.

Returns:

output – Transformed component.

Return type:

SpatialComponent

grey_opening(func, attr, *args, inplace=False, **kwargs)

Compute grey_opening for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.grey_opening.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.grey_opening.

Returns:

output – Transformed component.

Return type:

SpatialComponent

histogram(func, attr, *args, inplace=False, **kwargs)

Compute histogram for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.histogram.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.histogram.

Returns:

output – Transformed component.

Return type:

SpatialComponent

init_state(**kwargs)

Init state attributes.

items()

Returns pairs of attribute’s names and data.

keys()

Array of attributes.

label(func, attr, *args, inplace=False, **kwargs)

Compute label for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.label.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.label.

Returns:

output – Transformed component.

Return type:

SpatialComponent

labeled_comprehension(func, attr, *args, inplace=False, **kwargs)

Compute labeled_comprehension for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.labeled_comprehension.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.labeled_comprehension.

Returns:

output – Transformed component.

Return type:

SpatialComponent

laplace(func, attr, *args, inplace=False, **kwargs)

Compute laplace for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.laplace.

Returns:

output – Transformed component.

Return type:

SpatialComponent

load(path_or_buffer, **kwargs)

Load data from a file or buffer.

Parameters:
  • path_or_buffer (str of string buffer) – Source to read data from.

  • **kwargs (dict, optional) – Any kwargs to be passed to load method.

Returns:

comp – BaseComponent with loaded attributes.

Return type:

BaseComponent

map_coordinates(func, attr, *args, inplace=False, **kwargs)

Compute map_coordinates for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.map_coordinates.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.map_coordinates.

Returns:

output – Transformed component.

Return type:

SpatialComponent

maximum(func, attr, *args, inplace=False, **kwargs)

Compute maximum for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum.

Returns:

output – Transformed component.

Return type:

SpatialComponent

maximum_filter(func, attr, *args, inplace=False, **kwargs)

Compute maximum_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

maximum_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute maximum_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

maximum_position(func, attr, *args, inplace=False, **kwargs)

Compute maximum_position for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.maximum_position.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.maximum_position.

Returns:

output – Transformed component.

Return type:

SpatialComponent

mean(func, attr, *args, inplace=False, **kwargs)

Compute mean for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.mean.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.mean.

Returns:

output – Transformed component.

Return type:

SpatialComponent

median(func, attr, *args, inplace=False, **kwargs)

Compute median for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.median.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.median.

Returns:

output – Transformed component.

Return type:

SpatialComponent

median_filter(func, attr, *args, inplace=False, **kwargs)

Compute median_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.median_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.median_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

minimum(func, attr, *args, inplace=False, **kwargs)

Compute minimum for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum.

Returns:

output – Transformed component.

Return type:

SpatialComponent

minimum_filter(func, attr, *args, inplace=False, **kwargs)

Compute minimum_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

minimum_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute minimum_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

minimum_position(func, attr, *args, inplace=False, **kwargs)

Compute minimum_position for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.minimum_position.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.minimum_position.

Returns:

output – Transformed component.

Return type:

SpatialComponent

morphological_gradient(func, attr, *args, inplace=False, **kwargs)

Compute morphological_gradient for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.morphological_gradient.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.morphological_gradient.

Returns:

output – Transformed component.

Return type:

SpatialComponent

morphological_laplace(func, attr, *args, inplace=False, **kwargs)

Compute morphological_laplace for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.morphological_laplace.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.morphological_laplace.

Returns:

output – Transformed component.

Return type:

SpatialComponent

multiply_attribute(attr, multiplier, box)

Multiply attribute by a constant.

Parameters:
  • attr (str) – Attribute to be modfied.

  • multiplier (float) – Multiplier.

  • box (Sequence[int, int, int, int, int, int]) – (i1, i2, j1, j2, k1, k2) - Box in which attribute values should be multiplyed by a constant (attr[i1:i2, j1:j2, k1:k2]) = attr[i1:i2, j1:j2, k1:k2]*multiplier).

Returns:

self

Return type:

self.__class__

pad(func, attr, *args, inplace=False, **kwargs)

Compute padded array for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.pad.

  • kwargs (misc) – Any additional named arguments to numpy.pad.

Returns:

output – Transformed component.

Return type:

SpatialComponent

pad_na(attr, fill_na=0.0, inplace=True)[source]

Add dummy cells into the rock vector in the positions of non-active cells if necessary.

Parameters:
  • attr (str, array-like) – Attributes to be padded with non-active cells.

  • actnum (array-like of type bool) – Vector representing a mask of active and non-active cells.

  • fill_na (float) – Value to be used as filler.

  • inplace (bool) – Modify сomponent inplace.

Returns:

output

Return type:

component if inplace else padded attribute.

percentile_filter(func, attr, *args, inplace=False, **kwargs)

Compute percentile_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.percentile_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.percentile_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

prewitt(func, attr, *args, inplace=False, **kwargs)

Compute prewitt for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.prewitt.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.prewitt.

Returns:

output – Transformed component.

Return type:

SpatialComponent

random_noise(func, attr, *args, inplace=False, **kwargs)

Compute array with added random noise of various types for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to random_noise.

  • kwargs (misc) – Any additional named arguments to random_noise.

Returns:

output – Transformed component.

Return type:

SpatialComponent

rank_filter(func, attr, *args, inplace=False, **kwargs)

Compute rank_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.rank_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.rank_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

ravel(attr=None, inplace=True, **kwargs)

Brings component to ravel state. If not inplace returns ravel representation for attributes with pre-defined ravel transformation.

Parameters:
  • attr (str, array of str) – Attribute to ravel.

  • inplace (bool) – Modify сomponent inplace.

  • kwargs (misc) – Additional named arguments.

Returns:

out

Return type:

component if inplace else raveled attribute.

rescale(func, attr, *args, inplace=False, **kwargs)

Compute rescale for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to skimage.transform.rescale.

  • kwargs (misc) – Any additional named arguments to skimage.transform.rescale.

Returns:

output – Transformed component.

Return type:

SpatialComponent

reshape(attr, newshape, order='C', inplace=True)

Reshape numpy.ndarray attributes.

Parameters:
  • attr (str, array of str) – Attribute to be reshaped.

  • newshape (tuple) – New shape.

  • order (str) – Numpy reshape order. Default to ‘C’.

  • inplace (bool) – If True, reshape is made inplace, return BaseComponent. Else, return reshaped attribute.

Returns:

output

Return type:

BaseComponent if inplace else reshaped attribute itself.

resize(func, attr, *args, inplace=False, **kwargs)

Compute resize for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to skimage.transform.resize.

  • kwargs (misc) – Any additional named arguments to skimage.transform.resize.

Returns:

output – Transformed component.

Return type:

SpatialComponent

rot90(func, attr, *args, inplace=False, **kwargs)

Compute rotated an array by 90 degrees in the plane specified by axes for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to numpy.rot90.

  • kwargs (misc) – Any additional named arguments to numpy.rot90.

Returns:

output – Transformed component.

Return type:

SpatialComponent

rotate(func, attr, *args, inplace=False, **kwargs)

Compute rotate for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.rotate.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.rotate.

Returns:

output – Transformed component.

Return type:

SpatialComponent

sample_crops(attr, shape, size=1)

Sample random crops of fixed shape.

Parameters:
  • attr (str, array-like) – Attributes to sample crops from. If None, use all attributes.

  • shape (tuple) – Shape of crops.

  • size (int, optional) – Number of crops to sample. Default to 1.

Returns:

crops – Sampled crops.

Return type:

ndarray

set_state(**kwargs)

State setter.

shift(func, attr, *args, inplace=False, **kwargs)

Compute shift for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.shift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.shift.

Returns:

output – Transformed component.

Return type:

SpatialComponent

show_histogram(attr, **kwargs)[source]

Show properties distribution.

Parameters:
  • attr (str) – Attribute to compute the histogram.

  • kwargs (misc) – Any additional named arguments to plt.hist.

Returns:

plot

Return type:

Histogram plot.

show_slice(attr, i=None, j=None, k=None, figsize=None, **kwargs)[source]

Visualize slices of 3D array. If no slice is specified, all 3 slices will be shown with interactive slider widgets.

Parameters:
  • attr (str) – Attribute to show.

  • i (int or None, optional) – Slice along x-axis to show.

  • j (int or None, optional) – Slice along y-axis to show.

  • k (int or None, optional) – Slice along z-axis to show.

  • figsize (array-like, optional) – Output plot size.

  • kwargs (dict, optional) – Additional keyword arguments for plot.

sobel(func, attr, *args, inplace=False, **kwargs)

Compute sobel for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.sobel.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.sobel.

Returns:

output – Transformed component.

Return type:

SpatialComponent

spline_filter(func, attr, *args, inplace=False, **kwargs)

Compute spline_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.spline_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.spline_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

spline_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute spline_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.spline_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.spline_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

standard_deviation(func, attr, *args, inplace=False, **kwargs)

Compute standard_deviation for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.standard_deviation.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.standard_deviation.

Returns:

output – Transformed component.

Return type:

SpatialComponent

property state

Get state.

strip_na(attr, inplace=True)[source]

Remove non-active cells from the rock vector.

Parameters:
  • attr (str, array-like) – Attributes to be stripped

  • inplace (bool) – Modify сomponent inplace.

Returns:

output

Return type:

component if inplace else stripped attribute.

sum(func, attr, *args, inplace=False, **kwargs)

Compute sum for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.sum.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.sum.

Returns:

output – Transformed component.

Return type:

SpatialComponent

sum_labels(func, attr, *args, inplace=False, **kwargs)

Compute sum_labels for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.sum_labels.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.sum_labels.

Returns:

output – Transformed component.

Return type:

SpatialComponent

to_spatial(attr=None, inplace=True, **kwargs)

Bring component to spatial state. If not inplace returns spatial representation for attributes with pre-defined spatial transformation.

Parameters:
  • attr (str, array of str) – Attribute to ravel.

  • inplace (bool) – Modify сomponent inplace.

  • kwargs (misc) – Additional named arguments.

Returns:

out

Return type:

сomponent if inplace else raveled attribute.

uniform_filter(func, attr, *args, inplace=False, **kwargs)

Compute uniform_filter for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.uniform_filter.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.uniform_filter.

Returns:

output – Transformed component.

Return type:

SpatialComponent

uniform_filter1d(func, attr, *args, inplace=False, **kwargs)

Compute uniform_filter1d for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.uniform_filter1d.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.uniform_filter1d.

Returns:

output – Transformed component.

Return type:

SpatialComponent

upscale(attr, factors, weights=None)[source]

Upscale properties.

Parameters:
  • attr (str, list of str) – Attributes to be upscaled.

  • factors (tuple, int) – Scale factors along each axis. If int, factors are the same for each axis.

  • weights (ndarray, same shape as attr, optional) – Cell weights.

Returns:

out – Upscaled properties.

Return type:

ndarray

values()

Returns a generator of attribute’s data.

variance(func, attr, *args, inplace=False, **kwargs)

Compute variance for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.variance.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.variance.

Returns:

output – Transformed component.

Return type:

SpatialComponent

watershed_ift(func, attr, *args, inplace=False, **kwargs)

Compute watershed_ift for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.watershed_ift.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.watershed_ift.

Returns:

output – Transformed component.

Return type:

SpatialComponent

white_tophat(func, attr, *args, inplace=False, **kwargs)

Compute white_tophat for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.white_tophat.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.white_tophat.

Returns:

output – Transformed component.

Return type:

SpatialComponent

zoom(func, attr, *args, inplace=False, **kwargs)

Compute zoom for given data.

Parameters:
  • attr (str, optional) – Attribute to get the data from.

  • args (misc) – Any additional positional arguments to scipy.ndimage.zoom.

  • kwargs (misc) – Any additional named arguments to scipy.ndimage.zoom.

Returns:

output – Transformed component.

Return type:

SpatialComponent