source: MML/trunk/at/atphysics/cavityoff.m @ 5

Last change on this file since 5 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 682 bytes
Line 
1%CAVITYOFF turns Cavities OFF
2% Sets PassMethod to DriftPass or IdentityPass depending
3% on the value of 'Length' field
4%
5% See also CAVITYON, RADIATIONON, RADIATIONOFF
6
7if isempty(whos('global','THERING'))
8   error('Global variable THERING could not be found');
9end
10localcavindex = findcells(THERING,'Frequency');
11
12if isempty(localcavindex)
13   disp('No cavities were found in the lattice');
14end
15
16
17for ii = localcavindex
18   if THERING{ii}.Length == 0;
19      THERING{ii}.PassMethod = 'IdentityPass';
20   else
21      THERING{ii}.PassMethod = 'DriftPass';
22   end
23end
24
25disp(strcat('Cavities located at index  [',num2str(localcavindex),  ']  were turned OFF'))     
26clear ii localcavindex
Note: See TracBrowser for help on using the repository browser.