-
Notifications
You must be signed in to change notification settings - Fork 0
/
md_output_onebyall.py
59 lines (45 loc) · 1.46 KB
/
md_output_onebyall.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
#md_output_onebyall.py
#Made by Jungmin Kim, SDlab
#find list to python
import glob
import os
print('='*60)
print('Made by Jkim. Made 180703 Ver 180703')
filelist_rdf=[] #List Declare
filelist_xyz=[]
command_rdf='plotrdf -a -np '
command_xyz='mdshak -r '
dirname_rdf='rdf_results'
dirname_xyz='xyz_results'
################ Dircheck % Mkdir ###############
if not os.path.isdir(dirname_rdf):
os.mkdir(dirname_rdf)
if not os.path.isdir(dirname_xyz):
os.mkdir(dirname_xyz)
################ filelist reading ###############
for file in glob.glob("*.mds"):
filelist_xyz.append(file)
for file in glob.glob("*s_*.out"): # Read filelist_rdf
filelist_rdf.append(file)
#################### plotrdf ####################
for ii in filelist_rdf:
(temp,trash)=os.path.splitext(ii) # Remove extension
command="%s%s.out > %s/%s.rdf" % (command_rdf,temp,dirname_rdf,temp)
os.system(command)
#print(command)
print_temp="Current Operation is 'plotrdf' of '%s'" % (temp)
print(print_temp)
#################### mdshak ####################
for ii in filelist_xyz:
(temp,trash)=os.path.splitext(ii) # Remove extension
command="%s%s.mds -f xyz -o %s/%s.xyz" % (command_xyz,temp,dirname_xyz,temp)
os.system(command)
#print(command)
print_temp="Current Operation is 'mdshak' of '%s'" % (temp)
print(print_temp)
print('='*60)
################# RDF_average.py ################
os.system("cd %s/" % dirname_rdf)
os.system("rdf_average_md_v2.py")
os.system("cd ../")