ocelot.adaptors

Package Contents

Functions

read_twi_file(namefile)

read_lattice_elegant(file_flo, file_par)

astraBeam2particleArray(filename, print_params=True)

function convert Astra beam distribution to Ocelot format - ParticleArray.

particleArray2astraBeam(p_array, filename='tytest.ast')

function convert Ocelot’s ParticleArray to Astra beam distribution and save to “filename”.

ocelot.adaptors.read_twi_file(namefile)
ocelot.adaptors.read_lattice_elegant(file_flo, file_par)
ocelot.adaptors.astraBeam2particleArray(filename, print_params=True)

function convert Astra beam distribution to Ocelot format - ParticleArray. Note that downloading ParticleArray from the astra file and saving it back does not give the same distribution. The difference arises because the array of particles does not have a reference particle, and in this case the first particle is used as a reference.

Parameters

print_params

Returns

ParticleArray

ocelot.adaptors.particleArray2astraBeam(p_array, filename='tytest.ast')

function convert Ocelot’s ParticleArray to Astra beam distribution and save to “filename”.

Note that downloading ParticleArray from the astra file and saving it back does not give the same distribution. The difference arises because the array of particles does not have a reference particle, and in this case the first particle is used as a reference.

Parameters
  • p_array

  • filename

Returns