diagonal

mdtools.box.diagonal(box, dtype=None, debug=False)[source]

Calculate the length of the diagonal of an orthogonal box.

Parameters:
  • box (array_like) – The box(es) for which to calculate the diagonal length. Must be orthogonal and provided as [lx, ly, lz] (shape (3,)) or as an array of [lx, ly, lz] (shape (k, 3), e.g. one box for each trajectory frame). The box(es) can also contain the angles like in the format returned by MDAnalysis.coordinates.base.Timestep.dimensions: [lx, ly, lz, alpha, beta, gamma]. In this case, it is checked if the box(es) is (are) orthogonal before calculating the diagonal length(s).

  • dtype (type, optional) – The data type of the returned array. If dtype is not given (default), infer the data type from box.

  • debug (bool, optional) – If True, check the input arguments. Default: False

    Deprecated since version 0.0.0.dev0: This argument is without functionality and will be removed in a future release.

Returns:

diagonal (scalar or numpy.ndarray) – The length of the diagonal of the box. If box was provided as an array of boxes, diagonal will be an array containing the length of the diagonal for each box.