LASY-org / lasy

https://lasydoc.readthedocs.io
Other
33 stars 24 forks source link

Accurate read RZ representation from openPMD file to LASY #310

Open MaxThevenet opened 1 month ago

MaxThevenet commented 1 month ago

This class https://github.com/LASY-org/lasy/blob/2c1f2496f3bfabd4922a8e4ef538fd13d53511a4/lasy/profiles/from_openpmd_profile.py#L12 can read from an openPMD file. Nevertheless, when using LASY in RT mode the data is assumed axisymmetric although LASY can in principle handle azimuthal mode decomposition. Rather than taking a cut at a given $\theta$, as currently done, I think the correct conversion between the modes of the full electric field in an openPMD file (as written by FBPIC for instance) and those used for the envelope in LASY is Screenshot 2024-10-21 at 15 20 08 where $px=1$ for linear polarization in $x$, $\mathcal{E}^m$ is mode $m$ in LASY and $E{r/\theta}^m$ is mode $m$ in FBPIC for $E_{r/\theta}$. Here, $i$ is the imaginary number. This should be implemented in the class mentioned above.

Additionally, reading all modes from the openPMD data should be done with openPMD-api instead of openPMD-viewer, so the dependency on openPMD-viewer can be dropped entirely. The operations should be symmetric to what is done in https://github.com/LASY-org/lasy/blob/2c1f2496f3bfabd4922a8e4ef538fd13d53511a4/lasy/utils/openpmd_output.py#L12