source: MML/trunk/machine/SOLEIL/StorageRing/insertions/Analyse_Bump_InVac.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 2.0 KB
Line 
1function Analyse_Bump_InVac(IDName,SESSION,Xmin,Xmax,Step,gap,gapmax,BPMtoSkip)
2% Calculate the field Integrals (Ix and Iz) for Horizontal Bumps inside the ID from the orbits previously stored
3% in the folder SESSION. The data in the folder SESSION must be saved in the following format: "BUMP_Xmm_GY.mat"
4% IDName: Name of the ID including the name of the BL
5% SESSION: Folder where the orbit data are saved
6% Xmin, Xmax, Step: extrema values and step of the Bumps in X (mm)
7% gap: gap of the ID
8% gapmax: maximum gap of the ID (Background gap)
9% BPMtoSkip: BPMs to  be skipped: ex: '[19,20]' or '[]' (default)
10% Example: Analyse_Bump_InVac('U20_GALAXIES','SESSION_27_06_10/BUMP_Gap55_Neg',-22,0,2,5.5,30, '[49,50]')
11% Analyse_Bump_InVac('WSV50_PSICHE','SESSION_28_06_10/BUMP_Gap55',-20,13,1,5.5,70,'[9,11,12,16,17,18,19,20,21,22,23,26,27,29,30,49,50,59,79,80,89,109,112]')
12
13fprintf ('%s\n','----------------------------------------------')
14fprintf ('%s\n','Entrefer[mm]      Bump[mm]         IX[G.m]         IZ[G.m]')
15i=1;
16Path=['/home/operateur/GrpGMI/' IDName '/' SESSION];
17fid= fopen([Path '/RESULTS_INTEGRALS_G' Num2Str(10*gap) '.txt'], 'w');
18fprintf (fid,'%s\n','Entrefer[mm]      Bump[mm]         IX[G.m]         IZ[G.m]')
19for X=Xmin:Step:Xmax
20    FileName=['BUMP_' Num2Str(X) 'mm_G' Num2Str(10*gap)];
21    Bckg=['BUMP_' Num2Str(X) 'mm_G' Num2Str(10*gapmax)];
22    PathAndFileName=[Path '/' FileName];
23    PathAndBckg=[Path '/' Bckg];
24    st =idCalcFldIntFromElecBeamMeasForUndSOLEIL_1(IDName,Path,PathAndFileName,PathAndBckg,'',BPMtoSkip,0,0);
25    IntegralX=st.I1X;
26    IntegralZ=st.I1Z;
27    XBump(i)=X;
28    IX(i)=IntegralX;
29    IZ(i)=IntegralZ;
30    fprintf('%8.4f\t %8.4f\t %8.4f\t %8.4f\n',gap,X,IntegralX,IntegralZ);
31    fprintf(fid,'%8.4f\t %8.4f\t %8.4f\t %8.4f\n',gap,X,IntegralX,IntegralZ);
32    i=i+1;
33end
34fprintf ('%s\n','----------------------------------------------')
35plot(XBump,IX,'-or',XBump,IZ,'-ob');
36Xlabel('VALEUR DU BUMP [mm]')
37Ylabel('INTEGRALE DE CHAMP [G.m]')
38grid on
39legend('IX','IZ')
40fclose(fid)
41end
Note: See TracBrowser for help on using the repository browser.