seidart.routines.materials module¶
- seidart.routines.materials.anisotropic_boolean(im: ndarray | list, matbool: ndarray | list, angvect: ndarray | list) Tuple[ndarray, ndarray]¶
Determines if materials identified in an image are anisotropic and provides corresponding angular file names if applicable.
- Parameters:
im (Union[np.ndarray, list]) – An array representing material IDs in an image.
matbool (Union[np.ndarray, list]) – Array indicating whether a material is anisotropic.
angvect (Union[np.ndarray, list]) – Array of angular file names for anisotropic materials.
- Returns:
A tuple of two arrays; the first indicates anisotropy (boolean), the second contains angular file names.
- Return type:
Tuple[np.ndarray, np.ndarray]
- seidart.routines.materials.bond(R: ndarray) ndarray¶
Calculates the 6x6 Bond transformation matrix from a 3x3 rotation matrix, useful for transforming stiffness or compliance matrices in crystallography and materials science.
- Parameters:
R (np.ndarray) – The 3x3 rotation matrix.
- Return M:
The 6x6 Bond transformation matrix.
- Rtype M:
np.ndarray
- seidart.routines.materials.fujita_complex_permittivity(temperature: float, frequency: float) float¶
Calculates the complex permittivity of ice using Fujita’s method, based on the provided temperature and frequency.
- Parameters:
temperature (float) – The temperature of ice in degrees Celsius.
frequency (float) – The frequency at which to calculate permittivity, in Hz.
- Returns:
The complex permittivity value.
- Return type:
float
- seidart.routines.materials.get_perm(material, modelclass) ndarray¶
Computes the permittivity and conductivity tensors for materials based on attributes contained within material and model class instances.
- Parameters:
material (Material) – An instance of a class containing attributes for materials, including temperature, density, porosity, water content, and anisotropic properties.
modelclass (Model) – An instance of a class containing modeling parameters, such as the frequency of interest for electromagnetic modeling.
- Returns:
A tensor array containing permittivity and conductivity values for each material.
- Return type:
np.ndarray
- seidart.routines.materials.get_seismic(material_name: list | ndarray = [None], temp: list | ndarray = [None], rho: list | ndarray = [None], porosity: list | ndarray = [0], lwc: list | ndarray = [0], anisotropic: list | ndarray = [False], angfile: list | ndarray = [None]) ndarray¶
Calculates seismic stiffness coefficients based on material properties, accounting for anisotropic conditions where applicable.
- Parameters:
material_name (Union[list, np.ndarray], optional) – Names of materials.
temp (Union[list, np.ndarray], optional) – Temperatures associated with each material.
rho (Union[list, np.ndarray], optional) – Densities of materials.
porosity (Union[list, np.ndarray], optional) – Porosities of materials.
lwc (Union[list, np.ndarray], optional) – Liquid water contents of materials.
anisotropic (Union[list, np.ndarray], optional) – Indicates if materials are anisotropic.
angfile (Union[list, np.ndarray], optional) – Angular files associated with anisotropic materials.
- Returns:
A tensor containing seismic stiffness coefficients.
- Return type:
np.ndarray
- seidart.routines.materials.ice_permittivity(temperature: float, density: float, center_frequency: float = None, method: str = 'fujita') ndarray¶
Computes the complex permittivity of ice given its temperature, density, and the frequency of interest. Supports different methods of calculation.
- Parameters:
temperature (float) – Temperature of the ice in degrees Celsius.
density (float) – Density of the ice in kg/m^3.
center_frequency (float, optional) – Frequency at which to compute permittivity, in Hz.
method (str) – The method used for calculating permittivity. Supports “kovacs” and “fujita”.
- Returns:
The complex permittivity tensor for ice.
- Return type:
np.ndarray
- seidart.routines.materials.ice_stiffness(temperature: float = None, pressure: float = 0.0) ndarray¶
Computes the stiffness tensor for ice under specified temperature and pressure conditions based on empirical relationships.
- Parameters:
temperature (float, optional) – The temperature at which to compute the stiffness tensor.
pressure (float) – The pressure at which to compute the stiffness tensor.
- Returns:
The stiffness tensor for ice.
- Return type:
np.ndarray
- seidart.routines.materials.isotropic_permittivity_tensor(temperature: float, porosity: float, water_content: float, material_name: str) Tuple[ndarray, ndarray]¶
Computes the isotropic permittivity tensor for a material based on temperature, porosity, water content, and the material’s inherent properties.
- Parameters:
temperature (float) – The temperature of the material.
porosity (float) – The porosity of the material.
water_content (float) – The water content in the material.
material_name (str) – The name of the material.
- Returns:
A tuple containing the permittivity and conductivity tensors.
- Return type:
Tuple[np.ndarray, np.ndarray]
- seidart.routines.materials.isotropic_stiffness_tensor(pressure: float, density: float, material_limits: ndarray) ndarray¶
Computes the isotropic stiffness tensor for a given material based on pressure, density, and predefined material properties.
- Parameters:
pressure (float) – The hydrostatic pressure to which the material is subjected.
density (float) – The density of the material.
material_limits (np.ndarray) – An array containing the material’s velocity limits and other relevant properties.
- Returns:
The isotropic stiffness tensor for the material.
- Return type:
np.ndarray
- seidart.routines.materials.porewater_correction(temperature: float, density: float, porosity: float, liquid_water_content: float) Tuple[float, float, float]¶
Applies corrections to the bulk density of a material based on its porosity and water content, considering temperature adjustments to the densities of air and water.
- Parameters:
temperature (float) – The temperature of the material.
density (float) – The initial density of the material.
porosity (float) – The porosity percentage of the material.
liquid_water_content (float) – The percentage of the pore space filled with water.
- Returns:
A tuple containing the corrected density, the density contribution from air, and the density contribution from water.
- Return type:
Tuple[float, float, float]
- seidart.routines.materials.pressure_array(im: list | ndarray, temp: list | ndarray, rho: list | ndarray, dz: list | ndarray, porosity: list | ndarray = [0], lwc: list | ndarray = [0]) Tuple[ndarray, ndarray, ndarray]¶
Computes the hydrostatic pressure, temperature, and density at each grid point based on material ID, accounting for porosity and water content.
- Parameters:
im (Union[list, np.ndarray]) – An m-by-n array of integer values representing material IDs.
temp (Union[list, np.ndarray]) – Temperatures at each grid point.
rho (Union[list, np.ndarray]) – Densities at each grid point.
dz (Union[list, np.ndarray]) – Vertical spacing between grid points.
porosity (Union[list, np.ndarray], optional) – Porosities at each grid point, default is a list of zeros.
lwc (Union[list, np.ndarray], optional) – Liquid water contents at each grid point, default is a list of zeros.
- Returns:
A tuple containing arrays for temperature, density, and hydrostatic pressure at each grid point.
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray]
- seidart.routines.materials.read_ang(filepath: str) ndarray¶
Reads Euler angles from a space delimited .ang file, typically associated with EBSD (Electron Backscatter Diffraction) data. Synthetic data can be built with the fabricsynth module.
- Parameters:
filepath (str) – The path to the .ang file.
- Returns:
An array of Euler angles extracted from the file.
- Return type:
np.ndarray
Note
The .ang file is expected to contain columns for Euler angles in radians, following Bunge’s notation (z-x-z rotation), among other data related to EBSD measurements.
- seidart.routines.materials.rho_water_correction(temperature: float = 0.0) float¶
Corrects the density of water based on temperature using the empirical formula derived from the Kell equation.
- Parameters:
temperature (float) – The temperature at which to compute the water density correction.
- Returns:
The corrected water density.
- Return type:
float
- seidart.routines.materials.rotator_zxz(eul: ndarray) ndarray¶
Generates a rotation matrix from Euler angles using the z-x-z rotation convention.
- Parameters:
eul (np.ndarray) – An array containing the three Euler angles.
- Returns:
The 3x3 rotation matrix derived from the Euler angles.
- Return type:
np.ndarray
- seidart.routines.materials.snow_conductivity(lwc: float = None, permittivity: ndarray = None, frequency: float = None) ndarray¶
Computes the electrical conductivity of snow given its liquid water content (LWC), permittivity, and frequency of interest.
- Parameters:
lwc (float, optional) – Liquid water content of the snow, optionally used if permittivity is not provided.
permittivity (np.ndarray, optional) – The complex permittivity of snow, if available.
frequency (float, optional) – Frequency at which conductivity is to be calculated, in Hz.
- Returns:
The conductivity tensor for snow.
- Return type:
np.ndarray
- seidart.routines.materials.snow_permittivity(density: float = 917.0, temperature: float = 0.0, lwc: float = 0.0, porosity: float = 50.0, center_frequency: float = 10000000.0, method: str = 'shivola-tiuri') ndarray¶
Calculates the complex permittivity of snow based on its density, temperature, liquid water content (LWC), porosity, and the chosen calculation method.
- Parameters:
density (float) – Density of the snow in kg/m^3.
temperature (float) – Temperature of the snow in degrees Celsius.
lwc (float) – Liquid water content of the snow in percentage.
porosity (float) – Porosity of the snow in percentage.
method (str) – The method to be used for calculating permittivity. Defaults to “shivola-tiuri”.
- Returns:
The complex permittivity tensor for snow.
- Return type:
np.ndarray