aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/plasma_lens/analysis.py
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2022-04-06 09:25:50 -0700
committerGravatar GitHub <noreply@github.com> 2022-04-06 09:25:50 -0700
commit5ea23bf77ad1f6e599769baf56b279c953cac01b (patch)
treec9421355368369221590bf48f30cf0ab856ea3ec /Examples/Tests/plasma_lens/analysis.py
parent4b3c619d81d6b8290c0b543a9b45f20e414823b9 (diff)
downloadWarpX-5ea23bf77ad1f6e599769baf56b279c953cac01b.tar.gz
WarpX-5ea23bf77ad1f6e599769baf56b279c953cac01b.tar.zst
WarpX-5ea23bf77ad1f6e599769baf56b279c953cac01b.zip
Added PlasmaLens class to PICMI (#3025)
* Added PlasmaLens class to PICMI * Added CI test * Added PICMI input file * Fixed the output dir for the CI test * Add `_plt` to Output File Prefix Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Diffstat (limited to 'Examples/Tests/plasma_lens/analysis.py')
-rwxr-xr-xExamples/Tests/plasma_lens/analysis.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Examples/Tests/plasma_lens/analysis.py b/Examples/Tests/plasma_lens/analysis.py
index f13ecb00f..6a0af60ad 100755
--- a/Examples/Tests/plasma_lens/analysis.py
+++ b/Examples/Tests/plasma_lens/analysis.py
@@ -60,7 +60,11 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength):
return x1, vx1
clight = c
-vel_z = eval(ds.parameters.get('my_constants.vel_z'))
+try:
+ vel_z = eval(ds.parameters.get('my_constants.vel_z'))
+except TypeError:
+ # vel_z is not saved in my_constants with the PICMI version
+ vel_z = 0.5*c
plasma_lens_period = float(ds.parameters.get('particles.repeated_plasma_lens_period'))
plasma_lens_starts = [float(x) for x in ds.parameters.get('particles.repeated_plasma_lens_starts').split()]