Density.normal_vectors#

Density.normal_vectors(coordinates)[source]#

Calculates the normal vectors for the given coordinates on the densities of the class instance. If the normal vector to a given coordinate can not be computed, the zero vector is returned instead. The output of this function can e.g. be used in tme.matching_optimization.NormalVectorScore.

Parameters:
coordinatesNDArray

An array of integer coordinates with shape (dimensions, coordinates) of which to calculate the normal vectors.

Returns:
NDArray

An array with unit normal vectors with same shape as coordinates.

Raises:
ValueError

If coordinates.shape[1] does not match self.data.ndim, coordinates.ndim != 2 or lies outside self.data.

References

[1]

Cragnolini T, Sahota H, Joseph AP, Sweeney A, Malhotra S, Vasishtan D, Topf M (2021a) TEMPy2: A Python library with improved 3D electron microscopy density-fitting and validation workflows. Acta Crystallogr Sect D Struct Biol 77:41–47. https://doi.org/10.1107/S2059798320014928