:mod:`ocelot.adaptors` ====================== .. py:module:: ocelot.adaptors Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 astra2ocelot/index.rst astra_lattice_converter/index.rst csrtrack2ocelot/index.rst elegant2ocelot/index.rst elegant_lattice_converter/index.rst genesis/index.rst genesis4/index.rst longlist2ocelot/index.rst mad8/index.rst madx/index.rst madx_old/index.rst srwutil/index.rst wake_t/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: ocelot.adaptors.read_twi_file ocelot.adaptors.read_lattice_elegant ocelot.adaptors.astraBeam2particleArray ocelot.adaptors.particleArray2astraBeam .. function:: read_twi_file(namefile) .. function:: read_lattice_elegant(file_flo, file_par) .. function:: 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. :param print_params: :type filename: str :return: ParticleArray .. function:: 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. :param p_array: :param filename: :return: