diff options
author | 2017-06-01 17:09:36 -0700 | |
---|---|---|
committer | 2017-06-01 17:09:36 -0700 | |
commit | 7211169494a60b9d9c20863cf32f4a81b8fa67be (patch) | |
tree | f03433a3d0dbcf5f6ac4bfc29e09ed8f94e1f5e7 /Example/Larmor/plot_particle_path.py | |
parent | 7da1a24bf2714d6038a19ab069977bab8d41c6d4 (diff) | |
download | WarpX-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.py | 10 |
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 |