summaryrefslogtreecommitdiff
path: root/solids
diff options
context:
space:
mode:
Diffstat (limited to 'solids')
-rw-r--r--solids/__init__.py12
-rw-r--r--solids/pmts.py11
-rw-r--r--solids/sno_cone.txt6
-rw-r--r--solids/sno_pmt_reduced.txt47
4 files changed, 70 insertions, 6 deletions
diff --git a/solids/__init__.py b/solids/__init__.py
index d37af7e..479bacd 100644
--- a/solids/__init__.py
+++ b/solids/__init__.py
@@ -1,6 +1,6 @@
import numpy as np
-from pmts import build_pmt, build_light_collector
+from pmts import build_pmt, build_light_collector, build_light_collector_from_file
import os
import sys
@@ -34,5 +34,11 @@ def build_12inch_pmt_with_lc_hd(outer_material=water, theta=np.pi/64):
@buildable('8inch_pmt')
-def build_8inch_pmt(outer_material=water, theta=np.pi/8):
- return build_pmt(dir + '/sno_pmt.txt', 0.003, outer_material, theta)
+def build_8inch_pmt(outer_material=water, theta=np.pi/12):
+ return build_pmt(dir + '/sno_pmt_reduced.txt', 0.003, outer_material, theta)
+
+@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)
+ return pmt + lc
diff --git a/solids/pmts.py b/solids/pmts.py
index 6b10522..377024d 100644
--- a/solids/pmts.py
+++ b/solids/pmts.py
@@ -64,3 +64,14 @@ def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8):
pmt.theta = theta
return pmt
+
+def build_light_collector_from_file(filename, outer_material, theta=np.pi/24):
+ profile = read_csv(filename)
+
+ # Convert mm to m
+ profile /= 1000.0
+
+ mesh = rotate_extrude(profile[:,0], profile[:,1], theta)
+ solid = Solid(mesh, outer_material, outer_material, color=0xFF0000,
+ surface=shiny_surface)
+ return solid
diff --git a/solids/sno_cone.txt b/solids/sno_cone.txt
index bf666cc..5b56792 100644
--- a/solids/sno_cone.txt
+++ b/solids/sno_cone.txt
@@ -4,10 +4,10 @@
-133.7058, 116.0503
-133.0342, 109.7357
-132.3659, 102.7194
--131.6944, 96.4048
+#-131.6944, 96.4048
-130.3251, 89.3909
--128.2481, 83.7831
--126.8788, 76.7691
+#-128.2481, 83.7831
+#-126.8788, 76.7691
-124.8018, 71.1613
-122.7282, 64.8516
-119.9503, 59.2462
diff --git a/solids/sno_pmt_reduced.txt b/solids/sno_pmt_reduced.txt
new file mode 100644
index 0000000..eceaadf
--- /dev/null
+++ b/solids/sno_pmt_reduced.txt
@@ -0,0 +1,47 @@
+#DataThief /Users/stan/Downloads/./sno_pmt.png Wednesday 27-Jul-2011 11:20:44 AM
+#-0.7993, -96.1588
+#13.2215, -96.1106
+#27.2424, -96.0623
+#34.2823, -89.7213
+#37.8465, -77.0754
+#46.3081, -66.5182
+#57.551, -60.8646
+65.305, -51.7136
+75.8632, -42.553
+87.1094, -36.1975
+92.7603, -27.0538
+99.1188, -16.5038
+101.2842, -3.1609
+100.6389, 8.7687
+97.1926, 21.3905
+91.64, 33.3031
+83.2766, 43.8024
+73.498, 51.4893
+62.3141, 58.4695
+51.1237, 64.046
+39.2288, 68.9181
+26.6265, 72.3841
+13.3165, 74.4439
+-0.701, 75.0976
+-14.7219, 75.0493
+-27.3537, 72.1984
+-39.9889, 68.6456
+-51.9295, 63.6914
+-63.8767, 57.3335
+-75.1262, 50.2761
+-84.9801, 41.8197
+-93.4417, 31.2626
+-99.0992, 20.7151
+-101.9656, 7.3697
+-101.3268, -5.9636
+-99.2859, -19.2921
+-94.431, -30.5053
+-86.0677, -41.0045
+-76.2957, -50.0952
+-65.8128, -57.0778
+-54.6256, -63.3562
+#-43.445, -71.0383
+#-37.8858, -81.5472
+#-35.8449, -94.8757
+#-22.5316, -96.2336
+#-8.5108, -96.1854