1 | function 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 | |
---|
13 | fprintf ('%s\n','----------------------------------------------') |
---|
14 | fprintf ('%s\n','Entrefer[mm] Bump[mm] IX[G.m] IZ[G.m]') |
---|
15 | i=1; |
---|
16 | Path=['/home/operateur/GrpGMI/' IDName '/' SESSION]; |
---|
17 | fid= fopen([Path '/RESULTS_INTEGRALS_G' Num2Str(10*gap) '.txt'], 'w'); |
---|
18 | fprintf (fid,'%s\n','Entrefer[mm] Bump[mm] IX[G.m] IZ[G.m]') |
---|
19 | for 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; |
---|
33 | end |
---|
34 | fprintf ('%s\n','----------------------------------------------') |
---|
35 | plot(XBump,IX,'-or',XBump,IZ,'-ob'); |
---|
36 | Xlabel('VALEUR DU BUMP [mm]') |
---|
37 | Ylabel('INTEGRALE DE CHAMP [G.m]') |
---|
38 | grid on |
---|
39 | legend('IX','IZ') |
---|
40 | fclose(fid) |
---|
41 | end |
---|