diff options
author | Anthony LaTorre <telatorre@gmail.com> | 2011-05-16 15:03:39 -0400 |
---|---|---|
committer | Anthony LaTorre <telatorre@gmail.com> | 2011-05-16 15:03:39 -0400 |
commit | 095c328cb04a17730df14d84b604ab9fca4c27e5 (patch) | |
tree | 70b3fe13e508d9e49c7043ecdc7d9d98920b35a2 /test.py | |
parent | 9b75194d138b21e7f5f3ced6b1e7c330d618e051 (diff) | |
download | chroma-095c328cb04a17730df14d84b604ab9fca4c27e5.tar.gz chroma-095c328cb04a17730df14d84b604ab9fca4c27e5.tar.bz2 chroma-095c328cb04a17730df14d84b604ab9fca4c27e5.zip |
added 12 inch hamamatsu pmt model
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -23,11 +23,12 @@ source = open(source_directory + '/kernel.cu').read() mod = SourceModule(source, options=['-I ' + source_directory], no_extern_c=True, cache_dir=False) intersect_mesh = mod.get_function('intersect_mesh') rotate = mod.get_function('rotate') +translate = mod.get_function('translate') size = width, height = 800, 600 screen = pygame.display.set_mode(size) camera = Camera(size) -camera.position((0,300,50)) +camera.position((0,100,10)) origin, direction = camera.get_rays() @@ -47,6 +48,7 @@ direction_gpu = cuda.to_device(direction) import detectors geometry = detectors.build_lbne() +#geometry = detectors.load_lbne('./detectors/lbne_8bit.pkl') mesh = geometry.mesh mesh = mesh.reshape(mesh.shape[0]*3,3) @@ -88,10 +90,12 @@ states = np.empty(width*height, dtype=np.int32) states_gpu = cuda.to_device(states) block_size = 64 -for i in range(10000): +for i in range(10): rotate(np.int32(origin.size), origin_gpu, np.float32(np.pi/100), gpuarray.vec.make_float3(0,0,1), block=(block_size,1,1), grid=(width*height//block_size+1,1)) rotate(np.int32(direction.size), direction_gpu, np.float32(np.pi/100), gpuarray.vec.make_float3(0,0,1), block=(block_size,1,1), grid=(width*height//block_size+1,1)) + translate(np.int32(origin.size), origin_gpu, gpuarray.vec.make_float3(-.5*np.sin(i*np.pi/100), -.5*np.cos(i*np.pi/100), 0), block=(block_size,1,1), grid=(width*height//block_size+1,1)) + t0 = time.time() intersect_mesh(np.int32(origin.size), origin_gpu, direction_gpu, pixels_gpu, first_leaf, states_gpu, block=(block_size,1,1), grid=(width*height//block_size+1,1), texrefs=[mesh_tex, lower_bound_tex, upper_bound_tex, child_map_tex, child_len_tex]) cuda.Context.synchronize() |