KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
conv_xyz.py
Go to the documentation of this file.
1import numpy as np
2import pandas as pd
3import sys
4
5alist = ['C']*7 + ['O'] + ['H']*7 + ['C','H','N','H'] + ['C']*4 + ['N','H','C'] + ['H']*4
6au_2_ang = 0.52918
7
8if __name__ == '__main__':
9 file = sys.argv[1]
10 out = sys.argv[2]
11
12 df = pd.read_csv(file, sep='\s+')
13 t = df["t"]
14 xyz = df.filter(regex='I0x', axis=1).values
15
16 Nt = len(t)
17 N = len(xyz[0,:])
18 A = N//3
19
20 xyz = xyz.reshape((Nt,A,3))*au_2_ang
21
22 f = open(out, 'w')
23 for i in range(Nt):
24 f.write('%d\n'%A)
25 f.write('t=%f fs\n'%t[i])
26
27 for k in range(A):
28 f.write('%s %12.8e %12.8e %12.8e\n'%(alist[k], xyz[i,k,0], xyz[i,k,1], xyz[i,k,2]))
29 #f.write('\n')
30 f.close()
31 #print(np.shape(xyz))