Structure.centered#

Structure.centered()[source]#

Shifts the structure analogous to tme.density.Density.centered().

Returns:
Structure

A copy of the class instance whose data center of mass is in the center of the data array.

NDArray

The coordinate translation.

Examples

>>> from importlib_resources import files
>>> from tme import Structure
>>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
>>> structure = Structure.from_file(filename=fname)
>>> centered_structure, translation = structure.centered()
>>> translation
array([34.89391639,  4.05091072, 36.64736741])