Python package for deriving shape descriptors of voids in organic crystal structures.
The algorithm relies on spherical nearest neighbour interpolation and numerical integration on the surface of the sphere.
It is reliant on the following Python packages:
trimesh- Ppure Python library for loading and using triangular meshespyglet- Cross-platform windowing and multimedia libraryquadpy- Numerical integration, quadrature for various domainssknni- spherical k-nearest neighbors interpolation and is a geospatial interpolator
The surface integral of a function over the unit sphere,
is approximated in the Lebdev scheme as:
Loader.pyresponsible formeshloading. From the meshmesh.vertices.Tprovide the necessary cartesian coordinates of the relevant surface points.- Surface points are then processed by
projector.py. This is a two-step process: 1.project(xyz)project points onto the unit sphere. The radial extension is the dependent variable for our spherical function. 2.mk_obsrvconverts the Cartesian unit sphere point collection representaion to its spherical coordinate couterpart. - The Lebdev grid coordinates are then generated by the
get_lebdev_grid()inlebdev_grid.py.
All packages employed use a spherical-coordinate representation of the sample points. The convention for spherical coordinattes is, however poorly defined in both the notation and the defined bounds.
The physics (ISO) convention, is defined as
The mathematical version, also denoted
The azimuth is often restricted to the interval (−180°, +180°], or (−π, +π] in radians, instead of [0, 360°). This is the standard convention for geographic longitude. The range [0°, 180°] for inclination is equivalent to [−90°, +90°] for elevation (latitude).
We present the notations and boundary conditions for each package employed:
| Package | Angle ordering | Bounds |
|---|---|---|
Quadpi |
(azimuthal, polar) | |
skNNI |
(polar, azimuthal) | |
SciPy |
(azimuthal, polar) |
Evidently, there is total disagreement between packages. The points of interest are generated by quadpi and are subsequently passed to skNNI and SciPy:
Therefore, both the skNNI and SciPy function calls are wrapped by a function that preprocess the angular data to correct for the correct boundaries.