-
|
Hello, I am a graduate student working with WarpX v25.04. I am trying to create an external magnetic field from my own CSV data file. I have an example HDF5 file (example-femm-3d.h5) that works correctly with my simulation. I used a script to inspect its structure, and this is the "blueprint" I need to create: / (Root Group) My source data is a CSV file with scattered points (r, z, Hr, Hz) from a magnet design. My WarpX version seems to require the openPMD 1.0.0 standard. My questions are:
Thank you very much for your time and help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @dinhyi Here is an example reading fields from a text file (as a 2D array, as a function of 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. |
Beta Was this translation helpful? Give feedback.
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
randz), and writing a correspondingopenPMDfile:https://github.com/openPMD/openPMD-example-datasets/blob/draft/scripts/femm/openpmd_create_rz.py
Instead of using
h5py, we recommend usingopenPMD-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.