Rock¶
- class Rock(data=None, field=None)[source]¶
Rock component.
- 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:
- data_dict()¶
Create dict from attributes.
- property empty¶
True if component is empty else False.
- histogram(attr, **kwargs)[source]¶
Show distribution over active cells.
- Parameters:
attr (str) – Attribute to compute the histogram.
kwargs (misc) – Any additional named arguments to
plt.hist.
- Returns:
plot
- Return type:
Histogram plot.
- items()¶
Returns pairs of attribute’s names and data.
- load(data, binary_data, logger)¶
Load data.
- 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.
- ravel(attr, order='F')¶
Ravel attributes using Fortran order.
- reshape(attr, newshape, order='C', inplace=True)¶
Reshape numpy.ndarray attributes.
- Parameters:
- Returns:
output
- Return type:
BaseComponent if inplace else reshaped attribute itself.
- 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.