ChristopherMayes / lume-astra

Python wrapper for Astra (A Space Charge Tracking Algorithm, DESY) for eventual use in LUME https://christophermayes.github.io/lume-astra/
https://christophermayes.github.io/lume-astra/
Apache License 2.0
14 stars 9 forks source link

Question about distgen and Astra #9

Closed benyebonya closed 3 years ago

benyebonya commented 3 years ago

Hi, is there a way to save the distribution generated by distgen into an output that Astra can use as a particle distribution input?

ChristopherMayes commented 3 years ago

@benyebonya LUME-Astra handles particles as openPMD-beamphysics standard data. That is, all particles are immediately parsed as ParticleGroup objects. These can be used to write many formats, see: https://github.com/ChristopherMayes/openPMD-beamphysics/blob/master/examples/write_examples.ipynb

Distgen directly produces ParticleGroup objects as well https://github.com/ColwynGulliford/distgen Then are written with: P.write('your_file.h5')

benyebonya commented 3 years ago

Thanks a lot for the quick answer!