identify_surface
nanoCAT.bde.identify_surface
A module for identifying which atoms are located on the surface, rather than in the bulk
Index

Take a molecule and identify which atoms are located on the surface, rather than in the bulk. 

Identify the surface of mol using a convex hullbased approach. 
API
 nanoCAT.bde.identify_surface.identify_surface(mol, max_dist=None, tolerance=0.5, compare_func=<builtin function gt>)[source]
Take a molecule and identify which atoms are located on the surface, rather than in the bulk.
The function compares the position of all reference atoms in mol with its direct neighbors, the latter being defined as all atoms within a radius max_dist. The distance is then calculated between the reference atoms and the meanposition of its direct neighbours. A length of 0 means that the atom is surrounded in a spherical symmetric manner, i.e. it must be located in the bulk. Deviations from 0 conversely imply that an atom is located on the surface.
 Parameters
mol (arraylike [
float
], shape \((n, 3)\)) – An arraylike object with the Cartesian coordinates of the molecule.max_dist (
float
, optional) – The radius for defining which atoms constitute as neighbors. IfNone
, estimate this value using the radial distribution function of mol.tolerance (
float
) – The tolerance for considering atoms part of the surface. A higher value will impose stricter criteria, which might be necasary as the local symmetry of mol becomes less pronounced. Should be in the same units as the coordinates of mol.compare_func (
Callable
) – The function for evaluating the directneighbor distance. The default,__gt__()
, is equivalent to identifying the surface, while e.g.__lt__()
identifies the bulk.
 Returns
The (0based) indices of all atoms in mol located on the surface.
 Return type
numpy.ndarray
[int
], shape \((n,)\) Raises
ValueError – Raised if no atompairs are found within the distance max_dist. Implies that either the userspecified or guessed value is too small.
See also
guess_core_core_dist()
Estimate a value for max_dist based on the radial distribution function of mol.
 nanoCAT.bde.identify_surface.identify_surface_ch(mol, n=0.5, invert=False)[source]
Identify the surface of mol using a convex hullbased approach.
A convex hull represents the smallest set of points enclosing itself, thus defining a surface.
 Parameters
mol (arraylike [
float
], shape \((n, 3)\)) – A 2D arraylike object of Cartesian coordinates representing a polyhedron. The supplied polyhedron should be convex in shape.n (
float
) –Smoothing factor for constructing a convex hull. Should obey \(0 <= n <= 1\). Represents the degree of displacement of all atoms to a spherical surface; \(n = 1\) is a complete projection while \(n = 0\) means no displacement at all.
A nonzero value is generally recomended here, as the herein utilized
ConvexHull
class requires an adequate degree of surfaceconvexness, lest it fails to properly identify all valid surface points.invert (
bool
) – IfTrue
, return the indices of all atoms in the bulk rather than on the surface.
 Returns
The (0based) indices of all atoms in mol located on the surface.
 Return type
numpy.ndarray
[int
], shape \((n,)\)
See also
ConvexHull
Convex hulls in N dimensions.