angles#

Functions#

angle(atXYZ, a_index, b_index, c_index, *[, deg])

Method to calculate the angle between atoms with indices a_index, b_index, and c_index in the positions DataArray throughout time.

angle_cos_sin(atXYZ, a_index, b_index, c_index, *[, deg])

Method to calculate the cosine and sine of the angle between atoms with indices a_index, b_index, and c_index in the positions DataArray throughout time.

get_angles(…)

Identify triples of bonded atoms (using RDKit) and calculate bond angles for each frame.

Module Contents#

angle(atXYZ, a_index, b_index, c_index, *, deg=False)#

Method to calculate the angle between atoms with indices a_index, b_index, and c_index in the positions DataArray throughout time. The b_index specifies the center atom at which the angle is located. The other two indices specify the legs of the angle.

Can return results in radian (default) and degrees (if deg=True)

Parameters:
  • atXYZ (AtXYZ) – DataArray with positions

  • a_index (int) – Index of first atom.

  • b_index (int) – Index of second center atom comprising the angle.

  • c_index (int) – Index of third atom.

  • deg (bool, optional) – Flag whether the results should be in degrees instead of radian. Defaults to False.

Returns:

The resulting angles between the denoted atoms.

Return type:

xr.DataArray

angle_cos_sin(atXYZ, a_index, b_index, c_index, *, deg=False)#

Method to calculate the cosine and sine of the angle between atoms with indices a_index, b_index, and c_index in the positions DataArray throughout time. The b_index specifies the center atom at which the angle is located. The other two indices specify the legs of the angle.

Parameters:
  • atXYZ (AtXYZ) – DataArray with positions

  • a_index (int) – Index of first atom.

  • b_index (int) – Index of second center atom comprising the angle.

  • c_index (int) – Index of third atom.

  • deg (bool)

Returns:

The resulting angles between the denoted atoms.

Return type:

xr.DataArray

get_angles(atXYZ_source: shnitsel.data.tree.node.TreeNode[Any, shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray], structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) shnitsel.data.tree.node.TreeNode[Any, xarray.DataArray]#
get_angles(atXYZ_source: shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray, structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) xarray.DataArray

Identify triples of bonded atoms (using RDKit) and calculate bond angles for each frame.

Parameters:
  • atXYZ_source (xr.DataArray | TreeNode[Any, Trajectory | Frames | xr.Dataset | xr.DataArray] | Trajectory | Frames | xr.Dataset) – An xarray.DataArray of molecular coordinates, with dimensions atom and direction or another source of positional data like a trajectory, a frameset, a dataset representing either of those or a tree structure holding such data.

  • structure_selection (StructureSelection | StructureSelectionDescriptor, optional) – Object encapsulating feature selection on the structure whose positional information is provided in atXYZ. If this argument is omitted altogether, a default selection for all bonds within the structure is created.

  • deg (bool | Literal['trig'], optional) – Whether to return angles in degrees (as opposed to radians), by default True. Can also be set to the string literal trig if sin and cos of the calculated angle should be returned instead.

  • signed (bool, optional) – Whether the result should be returned with a sign or just as an absolute value in the range. Only relevant for trig option in deg.

Returns:

An xarray.DataArray of bond angles with dimension descriptor to index the angles along.

Return type:

TreeNode[Any, xr.DataArray] | xr.DataArray