:mod:`ocelot.gui` ================= .. py:module:: ocelot.gui Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 colormaps2d/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 accelerator/index.rst beam_plot/index.rst db_example1/index.rst designer/index.rst dfl_plot/index.rst genesis4_plot/index.rst genesis_plot/index.rst misc/index.rst moga_plt/index.rst optics/index.rst plot_gen_out/index.rst qrc_icons/index.rst settings_plot/index.rst sr_plot/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: ocelot.gui.plot_lattice ocelot.gui.plot_opt_func ocelot.gui.show_da ocelot.gui.show_mu ocelot.gui.show_density ocelot.gui.show_e_beam ocelot.gui.show_flux .. function:: plot_lattice(lat, axis, alpha=1.0, params={'kmax': 2.0, 'ang_max': 0.005}, s_start=0.0) .. function:: plot_opt_func(lat, tws, top_plot=['Dx'], legend=True, fig_name=None, grid=True, font_size=12, excld_legend=None) function for plotting: lattice (bottom section), vertical and horizontal beta-functions (middle section), other parameters (top section) such as "Dx", "Dy", "E", "mux", "muy", "alpha_x", "alpha_y", "gamma_x", "gamma_y" :param lat: MagneticLattice, :param tws: list if Twiss objects, :param top_plot: ["Dx"] - parameters which displayed in top section. Can be any attribute of Twiss class, e.g. top_plot=["Dx", "Dy", "alpha_x"] :param legend: True - displaying legend of element types in bottom section, :param fig_name: None - name of figure, :param grid: True - grid :param font_size: 16 - font size for any element of plot :param excld_legend: None, exclude type of element from the legend, e.g. excld_legend=[Hcor, Vcor] :return: .. function:: show_da(out_da, x_array, y_array, title='') .. function:: show_mu(contour_da, mux, muy, x_array, y_array, zones=None) .. function:: show_density(x, y, ax=None, nbins_x=250, nbins_y=250, interpolation='bilinear', xlabel=None, ylabel=None, nfig=50, title=None, figsize=None, grid=True, show_xtick_label=True, limits=None) Function shows density :param x: np.array :param y: np.array :param ax: None, subplot axis, if None creates standalone plot. :param nbins_x: 250, number of bins for 2D hist. in horz. plane :param nbins_y: 250, number of bins for 2D hist. in vertical plane :param interpolation: "bilinear". Acceptable values are 'none’, ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’ :param xlabel: None, otherwise "string" :param ylabel: None, otherwise "string" :param nfig: number of the figure :param title: title of the figure :param figsize: None or e.g. (8, 6) :param grid: True, show grid :param show_xtick_label: True :param label, None or string. :param limits, None or [[xmin, xmax], [ymin, ymax]] :return: .. function:: show_e_beam(p_array, nparts_in_slice=5000, smooth_param=0.05, nbins_x=200, nbins_y=200, interpolation='bilinear', inverse_tau=False, show_moments=False, nfig=40, title=None, figsize=None, grid=True, filename=None, headtail=True, filter_base=2, filter_iter=2, tau_units='mm') Shows e-beam slice parameters (current, emittances, energy spread) and beam distributions (dE/(p0 c), X, Y) against long. coordinate (S) Note: beam head is on the left side :param p_array: ParticleArray :param nparts_in_slice: number of particles per slice :param smoth_param: 0.05, smoothing parameters to calculate the beam current: sigma = smoth_param * np.std(p_array.tau()) :param nbins_x: number of bins for 2D hist. in horz. plane :param nbins_y: number of bins for 2D hist. in vertical plane :param interpolation: "bilinear", and acceptable values are 'none’, ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’ :param inverse_tau: False, inverse tau - head will be on the right side of figure :param show_moments: False, show moments (X_mean_slice and Y_mean_slice) in the density distribution :param nfig: number of the figure :param title: None or string - title of the figure :param figsize: None or e.g. (8, 6) :param grid: True, show grid :param filename: None or str, filename to save picture in the file :param headtail: True, shows where is the beam head is. :param filter_base: support of rectangle filter is 2*p+1 :param filter_iter: the number of the filter iterations :return: .. function:: show_flux(screen, show='Total', xlim=(0, 0), ylim=(0, 0), file_name=None, unit='mm', title=None, nfig=1, grid=True, xlog=False, ylog=False) Function to plot radiation flux density 1D and 3D :param screen: Screen class :param show: str, show polarization component, can be "Total", "Sigma" or "Pi" :param xlim: (0,0), xlimits, ignored if (0,0) :param ylim: (0,0), ylimits, ignored if (0,0) :param file_name: str, if None flux will be shown otherwise save to file :param unit: str, units for spatial axis, can be "mm" or "mrad", :param title: figure title :param nfig: figure number :param grid: True, if False not show the grid :param xlog: False, log scale for x-axis :param ylog: False, log scale for y-axis :return: