From 599bfdd94c1e980a532bc51db61f4849e79abea9 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Fri, 1 Jun 2012 11:21:00 -0400 Subject: Make the photon reduction used in the event display mode dynamically calculated to give about 10,000 initial photon vertices in the event. This is required to deal with events with very large numbers of photons, like scintillation events. --- chroma/camera.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chroma/camera.py b/chroma/camera.py index f23085f..92e2e82 100644 --- a/chroma/camera.py +++ b/chroma/camera.py @@ -680,7 +680,8 @@ class EventViewer(Camera): marker = Solid(pyramid, vacuum, vacuum) geometry = Geometry() - for pos in self.ev.photons_beg.pos[::100]: + sample_factor = max(1, len(self.ev.photons_beg.pos) / 10000) + for pos in self.ev.photons_beg.pos[::sample_factor]: geometry.add_solid(marker, displacement=pos, rotation=make_rotation_matrix(np.random.uniform(0,2*np.pi), uniform_sphere())) geometry = create_geometry_from_obj(geometry) -- cgit