:mod:`ocelot.cpbd.elements` =========================== .. py:module:: ocelot.cpbd.elements .. autoapi-nested-parse:: definition of magnetic lattice linear dimensions in [m] Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.cpbd.elements.Element ocelot.cpbd.elements.Monitor ocelot.cpbd.elements.Marker ocelot.cpbd.elements.Aperture ocelot.cpbd.elements.Quadrupole ocelot.cpbd.elements.Sextupole ocelot.cpbd.elements.Octupole ocelot.cpbd.elements.Drift ocelot.cpbd.elements.Bend ocelot.cpbd.elements.Edge ocelot.cpbd.elements.SBend ocelot.cpbd.elements.RBend ocelot.cpbd.elements.XYQuadrupole ocelot.cpbd.elements.Hcor ocelot.cpbd.elements.Vcor ocelot.cpbd.elements.Undulator ocelot.cpbd.elements.Cavity ocelot.cpbd.elements.CouplerKick ocelot.cpbd.elements.TWCavity ocelot.cpbd.elements.TDCavity ocelot.cpbd.elements.Solenoid ocelot.cpbd.elements.Multipole ocelot.cpbd.elements.Matrix ocelot.cpbd.elements.Pulse ocelot.cpbd.elements.UnknownElement ocelot.cpbd.elements.Sequence Functions ~~~~~~~~~ .. autoapisummary:: ocelot.cpbd.elements.survey .. py:class:: Element(eid=None) Bases: :class:`object` Element is a basic beamline building element Accelerator optics elements are subclasses of Element Arbitrary set of additional parameters can be attached if necessary .. method:: __hash__(self) Return hash(self). .. method:: __eq__(self, other) Return self==value. .. py:class:: Monitor(l=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Element is a basic beamline building element Accelerator optics elements are subclasses of Element Arbitrary set of additional parameters can be attached if necessary .. method:: __str__(self) Return str(self). .. py:class:: Marker(eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Element is a basic beamline building element Accelerator optics elements are subclasses of Element Arbitrary set of additional parameters can be attached if necessary .. method:: __str__(self) Return str(self). .. py:class:: Aperture(xmax=np.inf, ymax=np.inf, dx=0, dy=0, type='rect', eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Aperture xmax - half size in horizontal plane in [m], ymax - half size in vertical plane in [m], type - "rect" or "elliptical". .. method:: __str__(self) Return str(self). .. py:class:: Quadrupole(l=0.0, k1=0, k2=0.0, tilt=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` quadrupole l - length of lens in [m], k1 - strength of quadrupole lens in [1/m^2], k2 - strength of sextupole lens in [1/m^3], tilt - tilt of lens in [rad]. .. method:: __str__(self) Return str(self). .. py:class:: Sextupole(l=0.0, k2=0.0, tilt=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` sextupole l - length of lens in [m], k2 - strength of sextupole lens in [1/m^3]. .. method:: __str__(self) Return str(self). .. py:class:: Octupole(l=0.0, k3=0.0, tilt=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` octupole k3 - strength of octupole lens in [1/m^4], l - length of lens in [m]. .. method:: __str__(self) Return str(self). .. py:class:: Drift(l=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` drift - free space l - length of drift in [m] .. method:: __str__(self) Return str(self). .. py:class:: Bend(l=0.0, angle=0.0, k1=0.0, k2=0.0, e1=0.0, e2=0.0, tilt=0.0, gap=0.0, h_pole1=0.0, h_pole2=0.0, fint=0.0, fintx=None, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` bending magnet l - length of magnet in [m], angle - angle of bend in [rad], k1 - strength of quadrupole lens in [1/m^2], k2 - strength of sextupole lens in [1/m^3], tilt - tilt of lens in [rad], e1 - the angle of inclination of the entrance face [rad], e2 - the angle of inclination of the exit face [rad]. fint - fringe field integral fintx - allows (fintx > 0) to set fint at the element exit different from its entry value. gap - the magnet gap [m], NOTE in MAD and ELEGANT: HGAP = gap/2 h_pole1 - the curvature (1/r) of the entrance face h_pole1 - the curvature (1/r) of the exit face .. method:: __str__(self) Return str(self). .. py:class:: Edge(l=0.0, angle=0.0, k1=0.0, edge=0.0, tilt=0.0, dtilt=0.0, dx=0.0, dy=0.0, h_pole=0.0, gap=0.0, fint=0.0, pos=1, eid=None) Bases: :class:`ocelot.cpbd.elements.Bend` bending magnet l - length of magnet in [m], angle - angle of bend in [rad], k1 - strength of quadrupole lens in [1/m^2], k2 - strength of sextupole lens in [1/m^3], tilt - tilt of lens in [rad], e1 - the angle of inclination of the entrance face [rad], e2 - the angle of inclination of the exit face [rad]. fint - fringe field integral fintx - allows (fintx > 0) to set fint at the element exit different from its entry value. gap - the magnet gap [m], NOTE in MAD and ELEGANT: HGAP = gap/2 h_pole1 - the curvature (1/r) of the entrance face h_pole1 - the curvature (1/r) of the exit face .. method:: __str__(self) Return str(self). .. py:class:: SBend(l=0.0, angle=0.0, k1=0.0, k2=0.0, e1=0.0, e2=0.0, tilt=0.0, gap=0, h_pole1=0.0, h_pole2=0.0, fint=0.0, fintx=None, eid=None) Bases: :class:`ocelot.cpbd.elements.Bend` sector bending magnet, l - length of magnet in [m], angle - angle of bend in [rad], k1 - strength of quadrupole lens in [1/m^2], k2 - strength of sextupole lens in [1/m^3], tilt - tilt of lens in [rad], e1 - the angle of inclination of the entrance face [rad], e2 - the angle of inclination of the exit face [rad]. fint - fringe field integral fintx - allows (fintx > 0) to set fint at the element exit different from its entry value. gap - the magnet gap [m], NOTE in MAD and ELEGANT: HGAP = gap/2 h_pole1 - the curvature (1/r) of the entrance face h_pole1 - the curvature (1/r) of the exit face .. py:class:: RBend(l=0.0, angle=0.0, k1=0.0, k2=0.0, e1=None, e2=None, tilt=0.0, gap=0, h_pole1=0.0, h_pole2=0.0, fint=0.0, fintx=None, eid=None) Bases: :class:`ocelot.cpbd.elements.Bend` rectangular bending magnet, l - length of magnet in [m], angle - angle of bend in [rad], k1 - strength of quadrupole lens in [1/m^2], k2 - strength of sextupole lens in [1/m^3], tilt - tilt of lens in [rad], e1 - the angle of inclination of the entrance face [rad], e2 - the angle of inclination of the exit face [rad]. fint - fringe field integral fintx - allows (fintx > 0) to set fint at the element exit different from its entry value. gap - the magnet gap [m], NOTE in MAD and ELEGANT: HGAP = gap/2 h_pole1 - the curvature (1/r) of the entrance face h_pole1 - the curvature (1/r) of the exit face .. py:class:: XYQuadrupole(l=0.0, x_offs=0.0, y_offs=0.0, k1=0.0, tilt=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.SBend` Quadrupole with offsets (linear element). The element is to test a transport feature and it is not tested. l - length of magnet in [m], k1 - strength of quadrupole lens in [1/m^2], x_offs - offset in horizontal direction in [m] y_offs - offset in vertical direction in [m] tilt - tilt of lens in [rad], .. py:class:: Hcor(l=0.0, angle=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.RBend` horizontal corrector, l - length of magnet in [m], angle - angle of bend in [rad], .. method:: __str__(self) Return str(self). .. py:class:: Vcor(l=0.0, angle=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.RBend` horizontal corrector, l - length of magnet in [m], angle - angle of bend in [rad], .. method:: __str__(self) Return str(self). .. py:class:: Undulator(lperiod=0.0, nperiods=0, Kx=0.0, Ky=0.0, field_file=None, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Undulator lperiod - undulator period in [m]; nperiod - number of periods; Kx - undulator paramenter for vertical field; Ky - undulator parameter for horizantal field; field_file - absolute path to magnetic field data; mag_field - None by default, the magnetic field map function - (Bx, By, Bz) = f(x, y, z) eid - id of undulator. .. method:: validate(self) .. method:: __str__(self) Return str(self). .. py:class:: Cavity(l=0.0, v=0.0, phi=0.0, freq=0.0, vx_up=0, vy_up=0, vxx_up=0, vxy_up=0, vx_down=0, vy_down=0, vxx_down=0, vxy_down=0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Standing wave RF cavity v - voltage [GV] freq - frequency [Hz] phi - phase in [deg] vx_{up/down}, vy_{up/down} - zero order kick of a {up/down}stream coupler vxx_{up/down}, vxy_{up/down} - first order kick a {up/down}stream coupler .. method:: __str__(self) Return str(self). .. py:class:: CouplerKick(v=0.0, phi=0.0, freq=0.0, vx=0.0, vy=0.0, vxx=0.0, vxy=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Coupler Kick element for Cavity v - voltage [GV] freq - frequency [Hz] phi - phase in [deg] vx, vy - zero order kick of a stream coupler vxx, vxy - first order kick a stream coupler .. method:: __str__(self) Return str(self). .. py:class:: TWCavity(l=0.0, v=0.0, phi=0.0, freq=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Traveling wave cavity v - voltage [GV] freq - frequency [Hz] phi - phase in [deg] .. py:class:: TDCavity(l=0.0, freq=0.0, phi=0.0, v=0.0, tilt=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Transverse deflecting cavity - by default kick in horizontal plane l - length [m] v - voltage [GV/m] freq - frequency [Hz] phi - phase in [deg] tilt - tilt of cavity in [rad] .. method:: __str__(self) Return str(self). .. py:class:: Solenoid(l=0.0, k=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` Solenoid l - length in m, k - strength B0/(2B*rho) .. method:: __str__(self) Return str(self). .. py:class:: Multipole(kn=0.0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` kn - list of strengths .. method:: __str__(self) Return str(self). .. py:class:: Matrix(l=0.0, delta_e=0, eid=None, **kwargs) Bases: :class:`ocelot.cpbd.elements.Element` Matrix element l = 0 - m, length of the matrix element r = np.zeros((6, 6)) - R - elements, first order t = np.zeros((6, 6, 6)) - T - elements, second order delta_e = 0 - GeV, energy gain along the matrix element .. method:: __str__(self) Return str(self). .. py:class:: Pulse .. py:class:: UnknownElement(l=0, kick=0, xsize=0, ysize=0, volt=0, lag=0, harmon=0, refer=0, vkick=0, hkick=0, eid=None) Bases: :class:`ocelot.cpbd.elements.Element` l - length of lens in [m] .. py:class:: Sequence(l=0, refer=0) .. function:: survey(lat, ang=0.0, x0=0, z0=0) .. data:: a