summaryrefslogtreecommitdiff
path: root/solids
diff options
context:
space:
mode:
Diffstat (limited to 'solids')
-rw-r--r--solids/__init__.py24
-rw-r--r--solids/pmts.py18
2 files changed, 21 insertions, 21 deletions
diff --git a/solids/__init__.py b/solids/__init__.py
index 46f3119..a24ce9c 100644
--- a/solids/__init__.py
+++ b/solids/__init__.py
@@ -12,11 +12,11 @@ from optics import *
from view import buildable
@buildable('12inch_pmt')
-def build_12inch_pmt(outer_material=water, theta=np.pi/8):
- return build_pmt(dir + '/hamamatsu_12inch.txt', 0.003, outer_material, theta)
+def build_12inch_pmt(outer_material=water, nsteps=16):
+ return build_pmt(dir + '/hamamatsu_12inch.txt', 0.003, outer_material, nsteps)
@buildable('12inch_pmt_shell')
-def build_12inch_pmt_shell(outer_material=water, theta=np.pi/8):
+def build_12inch_pmt_shell(outer_material=water, nsteps=16):
return build_pmt_shell(dir + '/hamamatsu_12inch.txt')
# from Jelena Maricic
@@ -27,22 +27,22 @@ lc_12inch_rmin = 0.1524
lc_12inch_rmax = 0.235072
@buildable('12inch_pmt_with_lc')
-def build_12inch_pmt_with_lc(outer_material=water, theta=np.pi/8):
- pmt = build_12inch_pmt(outer_material, theta)
+def build_12inch_pmt_with_lc(outer_material=water, nsteps=16):
+ pmt = build_12inch_pmt(outer_material, nsteps)
return pmt + build_light_collector(pmt, a=lc_12inch_a, b=lc_12inch_b, d=lc_12inch_d, rmin=lc_12inch_rmin, rmax=lc_12inch_rmax)
@buildable('12inch_pmt_with_lc_hd')
-def build_12inch_pmt_with_lc_hd(outer_material=water, theta=np.pi/64):
- pmt = build_12inch_pmt(outer_material, theta)
+def build_12inch_pmt_with_lc_hd(outer_material=water, nsteps=128):
+ pmt = build_12inch_pmt(outer_material, nsteps)
return pmt + build_light_collector(pmt, a=lc_12inch_a, b=lc_12inch_b, d=lc_12inch_d, rmin=lc_12inch_rmin, rmax=lc_12inch_rmax, npoints=100)
@buildable('8inch_pmt')
-def build_8inch_pmt(outer_material=water, theta=np.pi/12):
- return build_pmt(dir + '/sno_pmt_reduced.txt', 0.003, outer_material, theta)
+def build_8inch_pmt(outer_material=water, nsteps=24):
+ return build_pmt(dir + '/sno_pmt_reduced.txt', 0.003, outer_material, nsteps)
@buildable('8inch_pmt_with_lc')
-def build_8inch_pmt_with_lc(outer_material=water, theta=np.pi/12):
- pmt = build_8inch_pmt(outer_material, theta)
- lc = build_light_collector_from_file(dir + '/sno_cone.txt', outer_material, theta)
+def build_8inch_pmt_with_lc(outer_material=water, nsteps=24):
+ pmt = build_8inch_pmt(outer_material, nsteps)
+ lc = build_light_collector_from_file(dir + '/sno_cone.txt', outer_material, nsteps)
return pmt + lc
diff --git a/solids/pmts.py b/solids/pmts.py
index a30d007..fcbc8fc 100644
--- a/solids/pmts.py
+++ b/solids/pmts.py
@@ -25,11 +25,11 @@ def build_light_collector(pmt, a, b, d, rmin, rmax, npoints=10):
lc_offset = np.interp(lc_radii[0], list(reversed(pmt_face_profile[:,0])), list(reversed(pmt_face_profile[:,1])))
- lc_mesh = rotate_extrude(lc_radii, lc_profile + lc_offset, pmt.theta)
+ lc_mesh = rotate_extrude(lc_radii, lc_profile + lc_offset, pmt.nsteps)
return Solid(lc_mesh, pmt.outer_material, pmt.outer_material, surface=shiny_surface)
-def build_pmt_shell(filename, outer_material=water, theta=np.pi/8):
+def build_pmt_shell(filename, outer_material=water, nsteps=16):
profile = read_csv(filename)
# slice profile in half
@@ -44,9 +44,9 @@ def build_pmt_shell(filename, outer_material=water, theta=np.pi/8):
# convert mm -> m
profile /= 1000.0
- return Solid(rotate_extrude(profile[:,0], profile[:,1], theta), glass, outer_material, color=0xeeffffff)
+ return Solid(rotate_extrude(profile[:,0], profile[:,1], nsteps), glass, outer_material, color=0xeeffffff)
-def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8):
+def build_pmt(filename, glass_thickness, outer_material=water, nsteps=16):
profile = read_csv(filename)
# slice profile in half
@@ -63,8 +63,8 @@ def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8):
offset_profile = offset(profile, -glass_thickness)
- outer_envelope_mesh = rotate_extrude(profile[:,0], profile[:,1], theta)
- inner_envelope_mesh = rotate_extrude(offset_profile[:,0], offset_profile[:,1], theta)
+ outer_envelope_mesh = rotate_extrude(profile[:,0], profile[:,1], nsteps)
+ inner_envelope_mesh = rotate_extrude(offset_profile[:,0], offset_profile[:,1], nsteps)
outer_envelope = Solid(outer_envelope_mesh, glass, outer_material)
@@ -78,16 +78,16 @@ def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8):
# light collector
pmt.profile = profile
pmt.outer_material = outer_material
- pmt.theta = theta
+ pmt.nsteps = nsteps
return pmt
-def build_light_collector_from_file(filename, outer_material, theta=np.pi/24):
+def build_light_collector_from_file(filename, outer_material, nsteps=48):
profile = read_csv(filename)
# Convert mm to m
profile /= 1000.0
- mesh = rotate_extrude(profile[:,0], profile[:,1], theta)
+ mesh = rotate_extrude(profile[:,0], profile[:,1], nsteps)
solid = Solid(mesh, outer_material, outer_material, surface=shiny_surface)
return solid