-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdaptiveCapScript.py
More file actions
62 lines (36 loc) · 1.49 KB
/
AdaptiveCapScript.py
File metadata and controls
62 lines (36 loc) · 1.49 KB
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
60
61
62
import FMC
import pickle
from numpy import *
import sys
from scipy.misc import imrotate
import multiprocessing
from numpy import abs as Abs
def AdaptiveImage(x):
a = pickle.load(open('/mnt/d/FMCScans/L-FBH-CapScans/5L-32-A11/'+x+'.p','rb'))
F = FMC.LinearCapture(25.,a['AScans'],0.6,32,d)
F.ProcessScans(100)
F.KeepElements(range(16))
Ic = []
Is = []
# H = []
#
# Dc = []
#
# Ds = []
for i in range(len(F.AScans)):
h = F.FitInterfaceLine(i,(-30.,0.,0.5),(5.,15.),cw)
F.GetAdaptiveDelays(linspace(0,16*0.6,100), linspace(h(0),h(0)+9.6,100), h, cw, 3.24)
Is.append(imrotate(Abs(F.ApplyTFM(i,['Band',0.,10.,cw])),55.))
# Ds.append(F.Delays)
F.GetAdaptiveDelays(linspace(0,16*0.6,100), linspace(h(0),h(0)+9.6,100), h, cw, 5.92)
# Dc.append(F.Delays)
Ic.append(imrotate(Abs(F.ApplyTFM(i,['Band',-10.,10.,cw])),55.))
# H.append(h)
# pickle.dump({'ShearImages':Is, 'CompressionImages':Ic, 'Heights':H, 'ShearDelays': Ds, 'CompressionDelays': Dc, 'Resolution':0.096},open('/mnt/d/FMCScans/L-FBH-CapScans/5L-32-A11/OverCapImages-'+x+'.p','wb'))
pickle.dump({'ShearImages':Is, 'CompressionImages':Ic, 'Resolution':0.096},open('/mnt/d/FMCScans/L-FBH-CapScans/5L-32-A11/OverCapImages-'+x+'.p','wb'))
return 0
fl = sys.argv[1::]
d = pickle.load(open('/mnt/d/FMCScans/ReferenceScans/MP-5L32-A11-Delays.p','rb'))
cw = 1.49
p = multiprocessing.Pool(len(fl))
r = p.map(AdaptiveImage, fl)