-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathfull_model.py
More file actions
50 lines (42 loc) · 1.44 KB
/
full_model.py
File metadata and controls
50 lines (42 loc) · 1.44 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
import pickle as pickle
from ray_tracer import BuildRaySet, RayTraceModel
from prisms import Prism, Rhomboid
input_rays = BuildRaySet(origin = (-7.42,15,0),
direction = (0,-1,0),
radius=1.0,
count=20)
prism = Prism(n_inside = 1.764+0.0j,
orientation=0.0,
elevation=0.0,
centre=(0,0,0),
rotation=0,
length=10.0,
height=7.07,
width=14.0,
)
rhomboid = Rhomboid(n_inside = 1.764+0.0j,
orientation=0.0,
elevation=0.0,
centre=(0,0,0),
rotation=0,
length=10.0,
height=7.07,
width=14.0,
slant=45.0)
#beamstop = BeamStop(width=10,height=10,
# centre=(7,0,-20))
#print "rhomboid", rhomboid.polydata
#print "beamstop", beamstop.polydata
#fname = "RayTracer.pickle"
#try:
# raise IOError("pass")
# fobj = file(fname, 'rb')
# model = pickle.load(fobj)
# fobj.close()
#except (IOError, EOFError, AttributeError):
# model = RayTraceModel(optics=[prism, rhomboid], rays=input_rays)
model = RayTraceModel(optics=[prism, rhomboid], rays=input_rays)
model.configure_traits()
#fobj = file("RayTracer.pickle",'wb')
#pickle.dump(model, fobj)
#fobj.close()