gemgis.utils.assign_properties#

gemgis.utils.assign_properties(lith_block: numpy.ndarray, property_dict: dict) numpy.ndarray#

Replacing lith block IDs with physical properties

Parameters
  • lith_block (np.ndarray) – GemPy lith block array containing the surface IDs

  • property_array (dict) – Dict containing the property values mapped to a surface ID

Returns

property_block – Array containing the properties

Return type

np.ndarray

New in version 1.0.x.

Example

>>> # Loading Libraries and lith_block plus reshaping
>>> import gemgis as gg
>>> import numpy as np
>>> lith_block = np.load('lith_block.npy').reshape(50,50,50)
>>> # Defining properties
>>> density_values = [0.1, 2.5, 3.0]
>>> # Creating dict
>>> density_dict = {k: v for k,v in zip(np.unique(np.round(lith_block)), density_values)}
>>> density_dict
{1.0: 0.1, 2.0: 2.5, 3.0: 3.0}
>>> # Assign properties
>>> property_block = gg.utils.assign_properties(lith_block=lith_block, property_dict=property_dict)