load_dtrj

mdtools.file_handler.load_dtrj(fname, **kwargs)[source]

Load a discrete trajectory stored as numpy.ndarray from a binary .npy file.

Parameters
  • fname (str) – Name of the file containing the discrete trajectory. The discrete trajectory must be stored as numpy.ndarray in the binary .npy format. The array must be of shape (n, f), where n is the number of compounds and f is the number of frames. The shape can also be (f,), in which case the array is expanded to shape (1, f). The array must only contain integers or floats whose fractional part is zero, because, the elements of a discrete trajectory are interpreted as the indices of the states in which a given compound is at a given frame.

  • kwargs (dict) – Additional keyword arguments to parse to numpy.load().

Returns

dtrj – The discrete trajectory loaded from file.

Return type

numpy.ndarray

See also

numpy.load()

Load arrays or pickled objects from .npy, .npz or pickled files

Notes

This function simply calls numpy.load() and checks whether the loaded numpy.ndarray is a suitable discrete trajectory.