-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe2proc3d_all.py
More file actions
executable file
·40 lines (25 loc) · 895 Bytes
/
e2proc3d_all.py
File metadata and controls
executable file
·40 lines (25 loc) · 895 Bytes
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
#!/usr/bin/env python
#This will convert all volumes within an HDF file into separate SPIDER volumes
#To run:
#./e2proc3d_all.py [number of volumes per file]
import glob
import subprocess
import sys
numVols=float(sys.argv[1])
list=glob.glob('volf*')
for line in list:
new=line.strip('.hdf')
for i in range(0,numVols):
next=i+1
cmd="e2proc3d.py --first=%s --last=%s %s %s_%03d.hdf" %(i,i,line,new,next)
subprocess.Popen(cmd,shell=True).wait()
cmd="proc3d %s_%03d.hdf %s_%03d.img imagic" %(new,next,new,next)
subprocess.Popen(cmd,shell=True).wait()
cmd="rm %s_%03d.hdf" %(new,next)
subprocess.Popen(cmd,shell=True).wait()
cmd="./e2proc3d_all.b %s_%03d" %(new,next)
subprocess.Popen(cmd,shell=True).wait()
cmd="rm %s_%03d.img" %(new,next)
subprocess.Popen(cmd,shell=True).wait()
cmd="rm %s_%03d.hed" %(new,next)
subprocess.Popen(cmd,shell=True).wait()