summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2012-06-01 11:21:00 -0400
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commit599bfdd94c1e980a532bc51db61f4849e79abea9 (patch)
treeebb85fdd6d81b70b7d904b50d9bb48f38f284ce5
parent02d1e3a84814da3f3ecc22c9ed094dc55383f2a2 (diff)
downloadchroma-599bfdd94c1e980a532bc51db61f4849e79abea9.tar.gz
chroma-599bfdd94c1e980a532bc51db61f4849e79abea9.tar.bz2
chroma-599bfdd94c1e980a532bc51db61f4849e79abea9.zip
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.
-rw-r--r--chroma/camera.py3
1 files changed, 2 insertions, 1 deletions
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)