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

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

Initial import--MML version from SOLEIL@2013

File size: 1.3 KB
Line 
1function outStruct = idCalcFldIntFromElecBeamMeasForUndSOLEIL_1(idName, dirMeasData, fileNameMeasMain, fileNameMeasBkgr, dirModel, arIndsBPMsToSkip)
2
3%Calculates effective first and second horizontal and vertical field
4%integrals of SOLEIL undulators from COD
5%for one measurement of the COD (read from the files: fileNameMeasMain, fileNameMeasBkgr)
6
7GeomParUnd = idGetGeomParamForUndSOLEIL(idName);
8
9ElecBeamModelData = idReadElecBeamModel(dirModel);
10mCODx = idCreateModelOrbDistMatr('x', ElecBeamModelData, GeomParUnd);
11mCODz = idCreateModelOrbDistMatr('z', ElecBeamModelData, GeomParUnd);
12
13dirStart = pwd;
14if strcmp(dirMeasData, '') == 0
15        cd(dirMeasData);
16end
17ElecBeamMeasMain = load(char(fileNameMeasMain));
18ElecBeamMeasBkgr = load(char(fileNameMeasBkgr));
19cd(dirStart);
20
21[outStruct.I1X, outStruct.I2X, outStruct.I1Z, outStruct.I2Z] = idCalcFldIntFromElecBeamMeas(ElecBeamMeasMain, ElecBeamMeasBkgr, mCODx, mCODz, arIndsBPMsToSkip, GeomParUnd.idLen, GeomParUnd.idKickOfst, ElecBeamModelData.E);
22
23outStruct.DX_Meas = ElecBeamMeasMain.X - ElecBeamMeasBkgr.X;
24outStruct.DZ_Meas = ElecBeamMeasMain.Z - ElecBeamMeasBkgr.Z;
25outStruct.KicksX = idLeastSqLinFit(mCODx, outStruct.DX_Meas, arIndsBPMsToSkip);
26outStruct.KicksZ = idLeastSqLinFit(mCODz, outStruct.DZ_Meas, arIndsBPMsToSkip);
27outStruct.DX_Fit = mCODx*outStruct.KicksX;
28outStruct.DZ_Fit = mCODz*outStruct.KicksZ;
29
30
31
Note: See TracBrowser for help on using the repository browser.