:mod:`ocelot.cpbd.physics_proc` =============================== .. py:module:: ocelot.cpbd.physics_proc Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.cpbd.physics_proc.PhysProc ocelot.cpbd.physics_proc.EmptyProc ocelot.cpbd.physics_proc.SaveBeam ocelot.cpbd.physics_proc.SmoothBeam ocelot.cpbd.physics_proc.LaserModulator ocelot.cpbd.physics_proc.LaserHeater ocelot.cpbd.physics_proc.PhaseSpaceAperture ocelot.cpbd.physics_proc.RectAperture ocelot.cpbd.physics_proc.BeamTransform ocelot.cpbd.physics_proc.SpontanRadEffects ocelot.cpbd.physics_proc.BeamAnalysis ocelot.cpbd.physics_proc.Chicane .. data:: _logger .. py:class:: PhysProc(step=1) Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. method:: prepare(self, lat) method is called at the moment of Physics Process addition to Navigator class. :param lat: :return: .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. method:: finalize(self, *args, **kwargs) the method is called at the end of tracking :return: .. py:class:: EmptyProc(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. py:class:: SaveBeam(filename) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: SmoothBeam Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Physics Process for the beam smoothing. Can be applied when number of particles is not enough. :attribute mslice: number of particles in the slice Examples -------- # lat is the MagneticLattice navi = Navigator(lat) smooth = SmoothBeam() smooth.mslice = 10000 navi.add_physics_process(smooth, start=elem, stop=elem) # elem is the lattice element where you want to apply smoothing .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: LaserModulator(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. method:: lambda_ph(self, energy) Wavelength of the laser pulse :param energy: in [GeV] - beam energy :return: wavelength in [m] .. method:: r56(self, energy) Method calculate R56 of the undulator :param energy: in [GeV] - beam energy :return: R56 in [m] .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: LaserHeater(step=1) Bases: :class:`ocelot.cpbd.physics_proc.LaserModulator` Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. py:class:: PhaseSpaceAperture(step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Method to cut beam in longitudinal (by default), horizontal or/and vertical direction :param longitudinal: True, cutting in longitudinal direction :param vertical: False, cutting in vertical direction :param horizontal: False, cutting in horizontal direction :param taumin: -5 longitudinal plane in [rms] from center of mass :param taumax: 5 longitudinal plane in [rms] from center of mass :param xmin: -5 horizontal plane in [rms] from center of mass :param xmax: 5 horizontal plane in [rms] from center of mass :param ymin: -5 vertical plane in [rms] from center of mass :param ymax: 5 vertical plane in [rms] from center of mass .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: RectAperture(xmin=-np.inf, xmax=np.inf, ymin=-np.inf, ymax=np.inf, step=1) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Method to cut beam in horizontal or/and vertical direction :param xmin: -np.inf horizontal plane in [m] :param xmax: np.inf horizontal plane in [m] :param ymin: -np.inf vertical plane in [m] :param ymax: np.inf vertical plane in [m] .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: BeamTransform(tws=None, x_opt=None, y_opt=None) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Beam matching .. method:: twiss(self) :property: .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. py:class:: SpontanRadEffects(K=0.0, lperiod=0.0, type='planar') Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Effects of the spontaneous radiation: energy loss and quantum diffusion .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. method:: energy_loss_und(self, energy, dz) .. method:: sigma_gamma_quant(self, energy, dz) rate of energy diffusion :param energy: electron beam energy :param Kx: undulator parameter :param lperiod: undulator period :param dz: length of the :return: sigma_gamma/gamma .. py:class:: BeamAnalysis(filename) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` Parent class for all Physics processes :method prepare(self, lat): - the method is called at the moment of Physics Process addition to Navigator class. :method apply(self, p_array, dz): - the method is called on every step. :attribute step: - number of steps in [Navigator.unit_step] self.step*Navigator.unit_step = [m] :attribute indx0: - number of start element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute indx1: - number of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute s_start: - position of start element in lattice - assigned in navigator.add_physics_proc() :attribute s_stop: - position of stop element in lattice.sequence - assigned in navigator.add_physics_proc() :attribute z0: - current position of navigator - assigned in track.track() before p.apply() .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: .. method:: finalize(self) the method is called at the end of tracking :return: .. py:class:: Chicane(r56, t566=0.0) Bases: :class:`ocelot.cpbd.physics_proc.PhysProc` simple physics process to simulate longitudinal dynamics in chicane .. method:: apply(self, p_array, dz) the method is called on every step. :param p_array: :param dz: :return: