dynsight.utilities.save_xyz_from_ndarray

dynsight.utilities.save_xyz_from_ndarray(output_path, coords, comment_line='# comment line', atom_type='C')[source]

Saves a .xyz file with the coordinates from a numpy.ndarray.

This saves an array of coordinates as an .xyz file. This is useful to visualize simple systems’ trajectory with visualization tools like Ovito. If your system requires more information that what is stored in a simple .xyz format, you should consider building a Trj object.

Parameters:
  • output_file – The path to the .xyz output trajectory.

  • coords (ndarray[Any, dtype[float64]]) – The array containing the coordinates of all the particles at each frame. Has shape (n_frames, n_atoms, 3).

  • comment_line (str) – The second line in each frame.

  • atom_type (str) – The type to assign to all atoms in the trajectory.

  • output_path (Path | str)

Return type:

None