xdatbus.fun_com =============== .. py:module:: xdatbus.fun_com Functions --------- .. autoapisummary:: xdatbus.fun_com.com_drift xdatbus.fun_com.com_contcar Module Contents --------------- .. py:function:: com_drift(xyz_path, frame_start=0, frame_end=None, save_csv=True, timestep=1) Calculate the center of mass (COM) drift velocity for a xyz file. Parameters ---------- xyz_path : str Path to the XYZ file. frame_start : int The first frame to consider. frame_end : int The last frame to consider. If None, considers all frames. save_csv : bool Whether to save the COM to a csv file. timestep : int The time difference between each frame, in appropriate time units. Default is 1. Returns ------- np.ndarray The COM drift velocity, represented as a 3-element numpy array. .. py:function:: com_contcar(poscar_path, contcar_path, del_inter=False) Correct the CONTCAR file by adding the COM drift to the coordinates of the CONTCAR file. The COM drift is calculated by fcom01_drift(). Parameters ---------- poscar_path : str Path to the POSCAR path. contcar_path : str Path to the CONTCAR file. del_inter : bool Delete the intermediate files created by this function.