sphractal.surfExact
Module Contents
Functions
|
Find the nearest and furthest point of a given box from a given atom. |
|
Find the nearest and furthest point of a given box from a given atom. |
|
Count the number of boxes that cover the outer spherical surface of a given atom. |
|
Serialised loop to scan the atoms for timing comparison with the parallelised version. |
|
Count the number of boxes that cover the outer spherical surface of a set of atoms for a given box size. |
|
Write out coordinates of scanned boxes. |
|
Find atoms with neighbours that are on the surface. |
|
Count the boxes that cover the outer surface of a set of overlapping spheres represented as exact spheres for different box sizes. |
- sphractal.surfExact.getNearFarCoord(scanBoxIdx, boxLen, lowBound, atomCoord, bufferDist=5.0)[source]
Find the nearest and furthest point of a given box from a given atom.
- sphractal.surfExact.scanBox(minXYZ, scanBoxIdxs, scanBoxNearFarXYZs, boxLen, atomIdx, atomRad, atomXYZ, atomNeighIdxs, atomsSurfIdxs, atomsXYZ, atomsNeighIdxs, bufferDist=5.0, rmInSurf=True)[source]
Find the nearest and furthest point of a given box from a given atom.
- sphractal.surfExact.scanAtom(args)[source]
Count the number of boxes that cover the outer spherical surface of a given atom.
- sphractal.surfExact.scanAtomsForLoop(atomsIdxs, magn, boxLen, minXYZ, atomsRad, atomsSurfIdxs, atomsXYZ, atomsNeighIdxs, bufferDist=5.0, rmInSurf=True)[source]
Serialised loop to scan the atoms for timing comparison with the parallelised version.
- sphractal.surfExact.scanAllAtoms(args)[source]
Count the number of boxes that cover the outer spherical surface of a set of atoms for a given box size.
- sphractal.surfExact.writeBoxCoords(atomsEle, atomsXYZ, allSurfBoxs, allBulkBoxs, minXYZ, boxLens, bufferDist, outDir, npName)[source]
Write out coordinates of scanned boxes.
- sphractal.surfExact.findAtomsWithSurfNeighs(atomsNeighIdxs, atomsSurfIdxs)[source]
Find atoms with neighbours that are on the surface.
- sphractal.surfExact.exactBoxCnts(atomsEle, atomsRad, atomsSurfIdxs, atomsXYZ, atomsNeighIdxs, maxRange, minMaxBoxLens, minXYZ, npName, outDir='outputs', numCPUs=None, numBoxLen=10, bufferDist=5.0, rmInSurf=True, writeBox=True, verbose=False)[source]
Count the boxes that cover the outer surface of a set of overlapping spheres represented as exact spheres for different box sizes.
- Parameters:
atomsEle (1D ndarray of strs) – Element type of each atom.
atomsRad (1D ndarray of floats) – Radius of each atom.
atomsSurfIdxs (1D ndarray of ints) – Indices of surface atoms.
atomsXYZ (2D ndarray of floats) – Cartesian coordinates of each atom.
atomsNeighIdxs (2D ndarray of ints) – Neighbour atoms indices of each atom.
maxRange (float) – Maximum range among all dimensions of the Cartesian space, defines the borders of the largest box.
minMaxBoxLens (tuple of floats) – Minimum and maximum box lengths.
minXYZ (1D ndarray of floats) – Minimum values of each dimension in the Cartesian space.
npName (str) – Identifier of the measured object, which forms part of the output file name, ideally unique.
outDir (str, optional) – Path to the directory to store the output files.
numCPUs (int, optional) – Number of CPUs to be used for parallelisation of tasks.
numBoxLen (int, optional) – Number of box lengths to use for the collection of the box count data, spaced evenly on logarithmic scale.
bufferDist (Union[int,float]) – Buffer distance from the borders of the largest box in Angstrom.
rmInSurf (bool, optional) – Whether to remove the surface points on the inner surface.
writeBox (bool, optional) – Whether to generate output files for visualisation.
verbose (bool, optional) – Whether to display the details.
- Returns:
scales (list of floats) – Box lengths.
counts (list of floats) – Number of boxes that cover the exact spherical surface of interest.
Examples
>>> eles, rads, xyzs, _, minxyz, maxxyz = readInp('example.xyz') >>> neighs, _ = findNN(rads, xyzs, minxyz, maxxyz, 1.2) >>> surfs = findSurf(xyzs, neighs, 'alphaShape', 5.0) >>> scalesES, countsES = exactBoxCnts(eles, rads, surfs, xyzs, neighs, 100, (0.2, 1), minxyz, 'example')