atplot#
Modules
PLOTFUNCTIONS |
Functions
Plots data generated by a user-supplied function |
|
Plots optical functions |
|
Helper function for ATPLOT |
|
Keep track of the nominal reference orbit through displaced elements |
- atbaseplot(ring)#
- Plots data generated by a user-supplied functionatbaseplot Plots THERING in the current axesatbaseplot(ring) Plots the lattice specified by RINGatbaseplot(ring,dpp) plots at momentum deviation dpp (default: 0)atbaseplot(…,[smin smax]) Zoom on the specified rangeatbaseplot(…,@plotfunction,plotargs)PLOTFUNCTION: User supplied function providing the values to be plottedPLOTARGS: Optional cell array of arguments to PLOTFUNCTIONPLOTFUNCTION is called as:[S,PLOTDATA]=PLOTFUNCTION(RING,DPP,PLOTARGS{:})S: longitudinal position, length(ring)+1 x 1PLOTDATA: structure array,PLOTDATA(1) describes data for the left (main) axisPLOTDATA(1).VALUES: data to be plotted, length(ring)+1 x nbcurvePLOTDATA(1).LABELS: curve labels, cell array, 1 x nbcurvePLOTDATA(1).AXISLABEL: stringPLOTDATA(2) optional, describes data for the right (secondary) axisatbaseplot(…,’optionname’,optionvalue,…) Available options:‘synopt’,true|false Plots the lattice elements‘labels’,REFPTS Display the names of selected element names‘index’,REFPTS Display the index of selected element names‘leftargs’,{properties} properties set on the left axis‘rightargs’,{properties} properties set on the right axis‘KeepAxis’ flag to keep R1,R2,T1,T2 at each slice indetailed plots (mandatory with vert. bend).atbaseplot(ax,…) Plots in the axes specified by AX. AX can precedeany previous argument combinationcurve=atbaseplot(…) Returns handles to some objects:CURVE.PERIODICIY ring periodicityCURVE.LENGTH structure lengthCURVE.DPP deltap/pCURVE.LEFT Handles to the left axis plotsCURVE.RIGHT Handles to the right axis plotsCURVE.LATTICE Handles to the Element patches: structure with fieldsDipole,Quadrupole,Sextupole,Multipole,BPM,Label
- atplot(ring)#
- Plots optical functionsatplot Plots THERING in the current axesatplot(ring) Plots the lattice specified by RINGatplot(ax,ring) Plots in the axes specified by AXatplot(ax,ring,dpp) Plots at momentum deviation DPPatplot(…,[smin smax]) Zoom on the specified rangeatplot(…,’optionname’,optionvalue,…) Available options:‘twiss_in’,structure of optics transferline optics(ex: [optics_struct,~,~]=atlinopt(ring,0,1);atplot(ring,[0 10],@plbeamsize,’twiss_in’,optics_struct);)‘comment’,true|false Prints lattice information (default:true)‘synopt’,true|false Plots the lattice elements‘labels’,REFPTS Display the names of selected element names‘index’,REFPTS Display the index of selected element names‘leftargs’,{properties} properties set on the left axis‘rightargs’,{properties} properties set on the right axis‘KeepAxis’ flag to keep R1,R2,T1,T2 at each slice indetailed plots (mandatory with vert. bend).atplot(…,@plotfunction,args…)Allows for a user supplied function providing the values to be plottedPLOTFUNCTION must be of form:PLOTDATA=PLOTFUNCTION(LINDATA,RING,DPP,args…)PLOTDATA: structure array,PLOTDATA(1) describes data for the left (main) axisPLOTDATA(1).VALUES: data to be plotted, length(ring)+1 x nbcurvePLOTDATA(1).LABELS: curve labels, cell array, 1 x nbcurvePLOTDATA(1).AXISLABEL: stringPLOTDATA(2) optional, describes data for the right (secondary) axisThe default function displayed below as an example plots beta functionsand dispersionfunction plotdata=defaultplot(lindata,ring,dpp,varargin)beta=cat(1,lindata.beta); % left axisplotdata(1).values=beta;plotdata(1).labels={’beta_x’,’beta_z’};plotdata(1).axislabel=’beta [m]’;dispersion=cat(2,lindata.Dispersion)’; % right axisplotdata(2).values=dispersion(:,1);plotdata(2).labels={’eta_x’};plotdata(2).axislabel=’dispersion [m]’;endcurve=atplot(…) Returns handles to some objects:CURVE.PERIODICIY ring periodicityCURVE.LENGTH structure lengthCURVE.DPP deltap/pCURVE.LEFT Handles to the left axis plotsCURVE.RIGHT Handles to the right axis plotsCURVE.LATTICE Handles to the Element patches: structure with fieldsDipole,Quadrupole,Sextupole,Multipole,BPM,LabelCURVE.COMMENT Handles to the Comment textatplot calls the more general ATBASEPLOT function, which uses a slightlydifferent syntax.See also
atbaseplot()
- atplotsyn(ax, ring)#
- Helper function for ATPLOTpatches=atplotsyn(ax,ring) Plots the magnetic elements found in RING
- atreforbit(ring)#
- Keep track of the nominal reference orbit through displaced elementsElement displacement vectors T1 and T2 are often used to introduce positioningerrors of elements. When plotting the resulting closed orbit or trajectories,it is useful to plot positions with respect to the theoretical reference ratherthan to the displaced reference. This function generates reference coordinatesxref and zref so that:- R(1) and R(3) are the particles horizontal and vertical positions withrespect to the actual (displaced) reference,- R(1)+xref and R(3)+zref are the positions with respect to the ideal reference.If any of T1 or T2 is part of the design of the ring, the referencetranslation can be skipped by setting a field ‘hideT1’ or ‘hideT2’ on theelement.INPUTS1. ring Ring structureOUTPUTS1. xref Horizontal reference orbit shift2. zref Vertical reference orbit shiftEXAMPLE1. [xref,zref]=atreforbit(ring)See also
atplot()