:mod:`ocelot.cpbd.track` ======================== .. py:module:: ocelot.cpbd.track Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.cpbd.track.Track_info Functions ~~~~~~~~~ .. autoapisummary:: ocelot.cpbd.track.aperture_limit ocelot.cpbd.track.arg_peaks ocelot.cpbd.track.spectrum ocelot.cpbd.track.find_nearest ocelot.cpbd.track.find_highest ocelot.cpbd.track.nearest_particle ocelot.cpbd.track.harmonic_position ocelot.cpbd.track.freq_analysis ocelot.cpbd.track.contour_da ocelot.cpbd.track.stable_particles ocelot.cpbd.track.phase_space_transform ocelot.cpbd.track.create_track_list ocelot.cpbd.track.ellipse_track_list ocelot.cpbd.track.track_nturns ocelot.cpbd.track.track_nturns_mpi ocelot.cpbd.track.fma ocelot.cpbd.track.da_mpi ocelot.cpbd.track.tracking_step ocelot.cpbd.track.track ocelot.cpbd.track.lattice_track ocelot.cpbd.track.merge_drifts ocelot.cpbd.track.update_effective_beta .. data:: __author__ :annotation: = Sergey Tomin .. data:: _logger .. data:: extrema_chk :annotation: = 1 .. function:: aperture_limit(lat, xlim=1, ylim=1) .. function:: arg_peaks(data, extrema_chk=extrema_chk) the function search peaks of spectrum and return positions of all peaks if extrema_chk == 1 uses numpy module if extrema_chk == 0 uses independent code (see below) .. function:: spectrum(data1D) input: 1D sample data output: frequency and fourier transform .. function:: find_nearest(positions, value) input: 1D array and value the function searches nearest value in the array to the given value .. function:: find_highest(sorted_posns, value, diap) input: 1D array and value the function searches highest value in the array to the given value .. function:: nearest_particle(track_list, xi, yi) .. function:: harmonic_position(data1D, nu=None, diap=0.1, nearest=False) function searches three highest harmonics and return: a. the highest if nu == None b. the nearest harmonics to the nu (if nu != None) .. function:: freq_analysis(track_list, lat, nturns, harm=True, diap=0.1, nearest=False, nsuperperiods=1) .. py:class:: Track_info(particle, x=0.0, y=0.0) .. method:: get_x(self) .. method:: get_xp(self) .. method:: get_y(self) .. method:: get_yp(self) .. function:: contour_da(track_list, nturns, lvl=0.9) the function defines contour of DA. If particle "lived" > lvl*nturns then we set up nturns if particle "lived" < lvl*nturns then we set up 0 .. function:: stable_particles(track_list, nturns) .. function:: phase_space_transform(x, y, tws) curved line of second order a11*x**2 + a22*y**2 + 2*a12*x*y + 2*a13*x + 2*a23*y + a33 = 0 gamma*x**2 + 2*alpha*x*x' + beta*x'**2 = const .. function:: create_track_list(x_array, y_array, p_array, energy=0.0) the function create list of Pxy .. function:: ellipse_track_list(beam, n_t_sigma=3, num=1000, type='contour') .. function:: track_nturns(lat, nturns, track_list, nsuperperiods=1, save_track=True, print_progress=True) .. function:: track_nturns_mpi(mpi_comm, lat, nturns, track_list, errors=None, nsuperperiods=1, save_track=True) .. function:: fma(lat, nturns, x_array, y_array, nsuperperiods=1) .. function:: da_mpi(lat, nturns, x_array, y_array, errors=None, nsuperperiods=1) .. function:: tracking_step(lat, particle_list, dz, navi) tracking for a fixed step dz :param lat: Magnetic Lattice :param particle_list: ParticleArray or Particle list :param dz: step in [m] :param navi: Navigator :return: None .. function:: track(lattice, p_array, navi, print_progress=True, calc_tws=True, bounds=None) tracking through the lattice :param lattice: Magnetic Lattice :param p_array: ParticleArray :param navi: Navigator :param print_progress: True, print tracking progress :param calc_tws: True, during the tracking twiss parameters are calculated from the beam distribution :param bounds: None, optional, [left_bound, right_bound] - bounds in units of std(p_array.tau()) :return: twiss_list, ParticleArray. In case calc_tws=False, twiss_list is list of empty Twiss classes. .. function:: lattice_track(lat, p) .. function:: merge_drifts(lat) .. function:: update_effective_beta(beam, lat)