From 7211169494a60b9d9c20863cf32f4a81b8fa67be Mon Sep 17 00:00:00 2001 From: atmyers Date: Thu, 1 Jun 2017 17:09:36 -0700 Subject: handle arbitrary numbers of particles. --- Example/Larmor/plot_particle_path.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Example/Larmor/plot_particle_path.py') diff --git a/Example/Larmor/plot_particle_path.py b/Example/Larmor/plot_particle_path.py index 81beccc8e..2dece53c2 100644 --- a/Example/Larmor/plot_particle_path.py +++ b/Example/Larmor/plot_particle_path.py @@ -74,12 +74,12 @@ def read_particle_data(fn, ptype="particle0"): with open(fn, 'rb') as f: f.seek(where) ints = np.fromfile(f, dtype = idtype, count=count) - floats = np.fromfile(f, dtype = fdtype, count=count) + floats = np.fromfile(f, dtype = fdtype, count=count) + + idata[ip:ip+count] = ints + rdata[ip:ip+count] = floats + ip += count - idata[ip] = ints - rdata[ip] = floats - ip += 1 - return idata, rdata -- cgit v1.2.3