:mod:`ocelot.adaptors.astra2ocelot` =================================== .. py:module:: ocelot.adaptors.astra2ocelot Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: ocelot.adaptors.astra2ocelot.exact_xp_2_xxstg_mad ocelot.adaptors.astra2ocelot.exact_xxstg_2_xp_mad ocelot.adaptors.astra2ocelot.exact_xp_2_xxstg_dp ocelot.adaptors.astra2ocelot.exact_xxstg_2_xp_dp ocelot.adaptors.astra2ocelot.exact_xp_2_xxstg_de ocelot.adaptors.astra2ocelot.exact_xxstg_2_xp_de ocelot.adaptors.astra2ocelot.astraBeam2particleArray ocelot.adaptors.astra2ocelot.particleArray2astraBeam ocelot.adaptors.astra2ocelot.emittance_analysis .. function:: exact_xp_2_xxstg_mad(xp, gamref) .. function:: exact_xxstg_2_xp_mad(xxstg, gamref) .. function:: exact_xp_2_xxstg_dp(xp, gamref) .. function:: exact_xxstg_2_xp_dp(xxstg, gamref) .. function:: exact_xp_2_xxstg_de(xp, gamref) .. function:: exact_xxstg_2_xp_de(xxstg, gamref) .. 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: .. function:: emittance_analysis(fileprefix='Exfel', trace_space=True, s_offset=None) To calculate emittance in the trace space the flag "Tr_EmitS=.T" is needed. The phase space is (x, px, y, py, z, pz) The trace space is (x, x’, y, y’, z, z’) :param fileprefix: file prefix to read files: fileprefix + '.Xemit.001', fileprefix + '.Yemit.001', fileprefix + '.Zemit.001', fileprefix + '.TRemit.001' :param trace_space: True, to calculate emittance in the trace space :param s_offset: None, if None use s coordinates from a file, if not None the s coordinate starts from "s_offset" :return: list of the twiss objects