Closed cr-xu closed 1 year ago
Fixes #4
astraBeam2particleArray
Particle distribution conversion validated with astraBeam2particleArray:
import ocelot.adaptors as oca import numpy as np from cheetah.utils import from_astrabeam parray = oca.astraBeam2particleArray("benchmark/astra/ACHIP_EA1_2021.1351.001") particles, energy = from_astrabeam("benchmark/astra/ACHIP_EA1_2021.1351.001") print("Maximal dev:", np.max((parray.rparticles.transpose() - particles))) # > Maximal dev: 4.51461784622964e-16
I thinke for now this would be sufficient.
Installing Cheetah with Ocelot as optional dependency will happen once Ocelot is on PYPI.
Fixes #4
astraBeam2particleArray
dependencyParticle distribution conversion validated with
astraBeam2particleArray
: