aboutsummaryrefslogtreecommitdiff
path: root/Examples/Modules/laser_injection/analysis_laser.py
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-10-25 13:32:32 -0700
committerGravatar GitHub <noreply@github.com> 2019-10-25 13:32:32 -0700
commitc30cda342d7b4521b35706040e7159411168caed (patch)
tree2a7f2b4e26783359ab965c6aa84efbe1c2e04529 /Examples/Modules/laser_injection/analysis_laser.py
parent398166af23cfadfbf989f73c9e973518ed7aca3c (diff)
parent7a2fe4f3c115eeb9bfb8d48268be53111ffd40e3 (diff)
downloadWarpX-c30cda342d7b4521b35706040e7159411168caed.tar.gz
WarpX-c30cda342d7b4521b35706040e7159411168caed.tar.zst
WarpX-c30cda342d7b4521b35706040e7159411168caed.zip
Merge pull request #477 from MaxThevenet/test_examples
Clean Examples and make sure all are tested
Diffstat (limited to 'Examples/Modules/laser_injection/analysis_laser.py')
-rwxr-xr-xExamples/Modules/laser_injection/analysis_laser.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/Modules/laser_injection/analysis_laser.py b/Examples/Modules/laser_injection/analysis_laser.py
new file mode 100755
index 000000000..1951bb29a
--- /dev/null
+++ b/Examples/Modules/laser_injection/analysis_laser.py
@@ -0,0 +1,23 @@
+#! /usr/bin/env python
+
+import sys
+import matplotlib
+matplotlib.use('Agg')
+import matplotlib.pyplot as plt
+import numpy as np
+
+# this will be the name of the plot file
+fn = sys.argv[1]
+
+# you can save an image to be displayed on the website
+t = np.arange(0.0, 2.0, 0.01)
+s = 1 + np.sin(2*np.pi*t)
+plt.plot(t, s)
+plt.savefig("laser_analysis.png")
+
+# return '0' for success, anything else for failure
+passed = True
+if passed:
+ sys.exit(0)
+else:
+ sys.exit(100)