aboutsummaryrefslogtreecommitdiff
path: root/Example/Larmor/plot_particle_path.py
diff options
context:
space:
mode:
authorGravatar atmyers <atmyers2@gmail.com> 2017-06-01 17:09:36 -0700
committerGravatar atmyers <atmyers2@gmail.com> 2017-06-01 17:09:36 -0700
commit7211169494a60b9d9c20863cf32f4a81b8fa67be (patch)
treef03433a3d0dbcf5f6ac4bfc29e09ed8f94e1f5e7 /Example/Larmor/plot_particle_path.py
parent7da1a24bf2714d6038a19ab069977bab8d41c6d4 (diff)
downloadWarpX-7211169494a60b9d9c20863cf32f4a81b8fa67be.tar.gz
WarpX-7211169494a60b9d9c20863cf32f4a81b8fa67be.tar.zst
WarpX-7211169494a60b9d9c20863cf32f4a81b8fa67be.zip
handle arbitrary numbers of particles.
Diffstat (limited to 'Example/Larmor/plot_particle_path.py')
-rw-r--r--Example/Larmor/plot_particle_path.py10
1 files changed, 5 insertions, 5 deletions
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