Utilities#
Lower-level building blocks used across DarSIA. Most users will not need these directly, but they are public and stable.
Grids and finite volumes#
|
Tensor grid. |
|
Build a |
|
Finite volume divergence operator. |
|
Finite volume mass matrix. |
|
Reconstruct full face fluxes from their normal and tangential components. |
Projection of normal fluxes on grid onto tangential components. |
|
|
Project scalar cell quantity to scalar face quantity via averaging. |
|
Reconstruct the vector fluxes on the cells from normal fluxes on the faces. |
Points, voxels and coordinates#
|
Cartesian coordinate. |
|
Container for collection of Coordinate. |
|
Voxel coordinate. |
|
Container for collection of Voxel. |
|
Voxel center coordinate. |
|
Container for collection of VoxelCenter. |
|
Quick-access constructor for Coordinate or CoordinateArray. |
|
Quick-access constructor for Voxel or VoxelArray. |
|
Quick-access constructor for VoxelCenter or VoxelCenterArray. |
|
Conversion of point to Coordinate. |
|
Conversion of point to Voxel. |
|
Conversion of point to VoxelCenter. |
Derivatives#
|
Forward difference of image matrix in direction of axis. |
|
Backward difference of image matrix in direction of axis. |
|
Laplace operator with homogeneous boundary conditions. |
Interpolation#
|
Determine a voxeled spatial map from measurements through polynomial interpolation. |
|
Interpolate data to image. |
|
Interpolate data from CSV to image. |
|
Build a voxelised spatial map from scattered measurements by RBF interpolation. |
|
Determine a voxeled spatial map from measurements through polynomial interpolation. |
Kernels#
Abstract base class for kernel. |
|
|
Gaussian kernel. |
|
Linear kernel. |
Linear solvers#
|
Abstract base class for solvers for the problem: mass_coeff * x - diffusion_coeff * laplace(x) = rhs |
|
Conjugate gradient solver based on scipy's cg for the problem: mass_coeff * x - diffusion_coeff * laplace(x) = rhs |
|
Jacobi solver for the problem: mass_coeff * x - diffusion_coeff * laplace(x) = rhs |
|
Muiltilvel solver for the problem: mass_coeff * x - diffusion_coeff * laplace(x) = rhs. |
Approximation and acceleration#
|
Anderson acceleration for fixed-point methods. |
Abstract class for approximation spaces. |
|
|
Linear combination of any approximation space. |
|
Global polynomial approximation space in 2d. |
|
Global radial polynomial approximation space in 2d. |
Detection#
|
Detects a color in an image. |
|
Detects a value in an image. |
|
Detects the point closest to a target. |
|
Returns the orthogonal colors to the input color. |
|
Performs monochromatic concentration analysis on an image. |
Data types and miscellany#
|
Convert image to the specified dtype. |
|
Enumeration of formats for data. |
Class containing two class methods, once detecting features, and matching features. |
|
|
Enum to represent the convergence status of an iterative solver. |
|
Extract representative colours from an image for given patches. |
|
Plot histograms for all HSV components present in a ROI of an image. |
|
Determine bounding box for a set of given coordinates. |
|
Inverse of |
|
Returns the perimeter of a box. |
|
Utility to extract random patches from a mask. |
|
Sorts the four points of a quadrilateral in a clockwise fashion. |
|
Analog of np.full_like but for darsia.Image objects. |
|
Analog of np.ones_like but for darsia.Image objects. |
|
Analog of np.zeros_like but for darsia.Image objects. |