Home > atphysics > LongitudinalDynamics > cavityoff.m

cavityoff

PURPOSE ^

CAVITYOFF turns cavities OFF

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CAVITYOFF turns cavities OFF
  Sets PassMethod to DriftPass or IdentityPass depending
  on the value of 'Length' field

  See also CAVITYON, RADIATIONON, RADIATIONOFF, SETCAVITY

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %CAVITYOFF turns cavities OFF
0002 %  Sets PassMethod to DriftPass or IdentityPass depending
0003 %  on the value of 'Length' field
0004 %
0005 %  See also CAVITYON, RADIATIONON, RADIATIONOFF, SETCAVITY
0006 
0007 if  ~evalin('base','~isempty(whos(''global'',''THERING''))')
0008    error('Global variable THERING could not be found');
0009 end
0010 
0011 if ~evalin('base','exist(''THERING'')')
0012     global THERING
0013 end
0014 
0015 localcavindex = findcells(THERING,'Frequency');
0016 
0017 if isempty(localcavindex)
0018    disp('No cavities were found in the lattice');
0019 end
0020 
0021 
0022 for ii = localcavindex
0023    if THERING{ii}.Length == 0;
0024       THERING{ii}.PassMethod = 'IdentityPass';
0025    else
0026       THERING{ii}.PassMethod = 'DriftPass'; 
0027    end
0028 end
0029 
0030 disp(strcat('Cavities located at index  [',num2str(localcavindex),  ']  were turned OFF'))     
0031 clear ii localcavindex

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