Skip to content

Commit 9d7c9b1

Browse files
committed
Merge pull request #6 from openPMD/update_data
Close #4 and #5: no particle in 3D example & erroneous basePath
2 parents 43932db + 7ea6c43 commit 9d7c9b1

8 files changed

Lines changed: 1102 additions & 0 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ tar -zxvf example-2d.tar.gz
1717
tar -zxvf example-3d.tar.gz
1818
tar -zxvf example-thetaMode.tar.gz
1919
```
20+
21+
Note: The datasets were produced with the Particle-In-Cell code
22+
[Warp](https://bitbucket.org/berkeleylab/warp), from the scripts in
23+
`scripts/`. The resolution is intentionally very low, so as to produce
24+
data of manageable size.

example-2d.tar.gz

-532 KB
Binary file not shown.

example-3d.tar.gz

-3.85 MB
Binary file not shown.

example-thetaMode.tar.gz

-92.3 KB
Binary file not shown.

scripts/main.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""
2+
This scripts runs Warp simulations which produce the openPMD data
3+
for this repository.
4+
5+
Usage
6+
-----
7+
Simply type in a terminal:
8+
$ python main.py
9+
"""
10+
import os
11+
12+
def produce_data( script_name, output_folder ):
13+
"""
14+
Run a Warp simulation and compress the resulting directory of data
15+
16+
Parameters
17+
----------
18+
script_name: string
19+
The name of the Warp script to be run
20+
21+
output_folder: string
22+
The name of the folder that will be created by Warp,
23+
and which is to be compressed
24+
"""
25+
# Run the simulation
26+
command_line = 'python %s' %script_name
27+
os.system( command_line )
28+
29+
# Compress the file
30+
tar_name = '%s.tar.gz' %output_folder
31+
if os.path.exists( tar_name ):
32+
os.remove( tar_name )
33+
command_line = 'tar -zcvf %s %s' %(tar_name, output_folder)
34+
os.system( command_line )
35+
36+
37+
if __name__ == '__main__':
38+
39+
# Run the 2D simulation
40+
produce_data( 'warp_2d_script.py', 'example-2d' )
41+
42+
# Run the thetaMode simulation
43+
produce_data( 'warp_thetaMode_script.py', 'example-thetaMode' )
44+
45+
# Run the 3D simulation
46+
produce_data( 'warp_3d_script.py', 'example-3d' )

0 commit comments

Comments
 (0)