do_binning#

diffsims.utils.discretise_utils.do_binning(x, loc, Rmax, d, GPU)[source]#

Utility function which takes in a mesh, atom locations, atom radius and minimal grid-spacing and returns a binned array of atom indices.

Parameters:
xlist [np.ndarray [float]], of shape [(nx,), (ny,), …]

Dictates the range of the box over which to bin atoms.

locnp.ndarray, (n, 3)

Atoms to bin.

Rmaxfloat > 3

Maximum radius of an atom (rounded up to 3).

dlist of float > 0

The finest permitted binning.

GPUbool

If True then constrains to memory of GPU rather than RAM.

Returns:
subListnp.ndarray [int]

subList[i0,i1,i2] is a list of indices [j0, j1, …, jn, -1,…] such that the only atoms which are contained in the box: [x[0].min()+i0*r,x[0].min(),+(i0+1)*r] x [x[1].min()+i1*r,x[1].min(),+(i1+1)*r]…

rnp.ndarray [float]

Size of each bin.

memint

Upper limit of memory in bytes.