Skip to content
Discussion options

You must be logged in to vote

Hi @dinhyi
Thanks for your interest in WarpX.

Here is an example reading fields from a text file (as a 2D array, as a function of r and z), and writing a corresponding openPMD file:
https://github.com/openPMD/openPMD-example-datasets/blob/draft/scripts/femm/openpmd_create_rz.py
Instead of using h5py, we recommend using openPMD-api (as in the above example).

Note that, in the above example, the format of the text file seems to be a bit different than the one that you have, but hopefully the example Python script linked above should be easily adaptable.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dinhyi
Comment options

Answer selected by dinhyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants