Home > pubtools > atvalue.m

atvalue

PURPOSE ^

ATVALUE extract array from lindata structure

SYNOPSIS ^

function v=atvalue(lindata,code,idx)

DESCRIPTION ^

ATVALUE            extract array from lindata structure

V=ATVALUE(LINDATA,CODE,IDX)

CODE: field name in the LINDATA structure. May be:

   ElemIndex   - ordinal position in the RING 
   SPos        - longitudinal position [m]
   ClosedOrbit - closed orbit column vector with 
                 components x, px, y, py (momentums, NOT angles)                        
   Dispersion  - dispersion orbit position vector with 
                 components eta_x, eta_prime_x, eta_y, eta_prime_y
                 calculated with respect to the closed orbit with 
                 momentum deviation DP
   gamma       - gamma parameter of the transformation to eigenmodes 
   mu          - [ mux, muy] horizontal and vertical betatron phase
   beta        - [betax, betay] vector
   alpha       - [alphax, alphay] vector
   emit66    - 6x6 emittance projections on x and y + energy spread
   emit44    - emittances of the projections of beam44 on x and y
   modemit    - [emitA emitB] emittance of modes A and B (should be constant)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function v=atvalue(lindata,code,idx)
0002 %ATVALUE            extract array from lindata structure
0003 %
0004 %V=ATVALUE(LINDATA,CODE,IDX)
0005 %
0006 %CODE: field name in the LINDATA structure. May be:
0007 %
0008 %   ElemIndex   - ordinal position in the RING
0009 %   SPos        - longitudinal position [m]
0010 %   ClosedOrbit - closed orbit column vector with
0011 %                 components x, px, y, py (momentums, NOT angles)
0012 %   Dispersion  - dispersion orbit position vector with
0013 %                 components eta_x, eta_prime_x, eta_y, eta_prime_y
0014 %                 calculated with respect to the closed orbit with
0015 %                 momentum deviation DP
0016 %   gamma       - gamma parameter of the transformation to eigenmodes
0017 %   mu          - [ mux, muy] horizontal and vertical betatron phase
0018 %   beta        - [betax, betay] vector
0019 %   alpha       - [alphax, alphay] vector
0020 %   emit66    - 6x6 emittance projections on x and y + energy spread
0021 %   emit44    - emittances of the projections of beam44 on x and y
0022 %   modemit    - [emitA emitB] emittance of modes A and B (should be constant)
0023 
0024 %IDX:   index of desired values (default: all)
0025 
0026 switch code
0027    case {'ClosedOrbit','Dispersion'}
0028    v=cat(2,lindata.(code))';
0029    otherwise
0030    v=cat(1,lindata.(code));
0031 end
0032 if nargin > 2
0033    v=v(:,idx);
0034 end

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005