Skip to content
Snippets Groups Projects
Commit c4905bb7 authored by zhang's avatar zhang
Browse files

Separate misalignment error and COD correction.

parent fc6c25a2
Branches
Tags
No related merge requests found
......@@ -10,11 +10,11 @@
extern const int nCOR;
extern const char hOrbitFileName[];
extern const char vOrbitFileName[];
extern const char OrbScanFileName[];
//extern const char hOrbitFileName[];
//extern const char vOrbitFileName[];
//extern const char OrbScanFileName[];
extern FILE *OrbScanFile;
// extern FILE *OrbScanFile;
/****** for orbit correction *********/
void prt_gcmat(int bpm, int corr, int plane);
......@@ -23,21 +23,17 @@ void gcmat(int bpm, int corr, int plane);
void lsoc(int niter, int bpm, int corr, int plane);
/***The following functions are copied from nsls-ii_lib_templ.h, need to be tested***/
bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, const char *ae_file, const int n_orbit,
const int n, const int k, const int nwh, const int nwv, int *hcorrIdx, int *vcorrIdx);
void readCorrectorList(const char *hCorrListName, const char *vCorrListName, int *hcorrIdx, int *vcorrIdx);
/***The following functions are copied from nsls-ii_lib_templ.h, need to be tested***/ void readCorrectorList(const char *hCorrListName, const char *vCorrListName, int *hcorrIdx, int *vcorrIdx);
void gcmats(int bpm, int corr, int plane, int *corrIdx);
void LoadFieldErrs(const char *FieldErrorFile, const bool Scale_it,
const double Scale, const bool new_rnd, const int ik);
bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, FILE *OrbitScanFile,
const char *ae_file, const int n_orbit, const int n, const int k, const int nwh, const int nwv, int *hcorrIdx, int *vcorrIdx);
bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, const char *ae_file, const int n_orbit,
const int n, const int k, const int nwh, const int nwv, int *hcorrIdx, int *vcorrIdx);
bool CorrectCODs(FILE *hOrbitFile, FILE *vOrbitFile, int n_orbit, int nwh, int nwv, int *hcorrIdx, int *vcorrIdx);
bool CorrectCODs(FILE *hOrbitFile, FILE *vOrbitFile,FILE *OrbScanFile, int n_orbit, int nwh, int nwv, int *hcorrIdx, int *vcorrIdx);
void lsoc2(int niter, int bpm, int corr, int plane, int nval);
......
......@@ -25,11 +25,11 @@ double *w_lsoc[2], **A_lsoc[2],**U_lsoc[2], **V_lsoc[2]; //response matrix bet
//global values
/* parameters for orbit correction */
const int nCOR = 250; // maximum number of correctors
const char hOrbitFileName[] = "horbit.out"; // LSN
const char vOrbitFileName[] = "vorbit.out"; //LSN
const char OrbScanFileName[] = "OrbScanFile.out";
//const char hOrbitFileName[] = "horbit.out"; // LSN
//const char vOrbitFileName[] = "vorbit.out"; //LSN
//const char OrbScanFileName[] = "OrbScanFile.out";
FILE *OrbScanFile;
//FILE *OrbScanFile;
......@@ -225,7 +225,7 @@ bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, const char *ae_file, cons
n_orbit number of iteration for orbit correction
n number of scaling
*******************************************************************************/
bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, const char *ae_file, const int n_orbit,
bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, FILE *OrbitScanFile,const char *ae_file, const int n_orbit,
const int n, const int k, const int nwh, const int nwv, int *hcorrIdx, int *vcorrIdx)
{
bool cod = false;
......@@ -242,7 +242,7 @@ bool CorrectCOD_Ns(FILE *hOrbitFile, FILE *vOrbitFile, const char *ae_file, cons
Align_BPM2quad(Quad);
}
cod = CorrectCODs(hOrbitFile, vOrbitFile, n_orbit, nwh, nwv, hcorrIdx, vcorrIdx);
cod = CorrectCODs(hOrbitFile, vOrbitFile,OrbitScanFile, n_orbit, nwh, nwv, hcorrIdx, vcorrIdx);
return cod;
}
......@@ -590,7 +590,7 @@ bool CorrectCODs(FILE *hOrbitFile, FILE *vOrbitFile, int n_orbit, int nwh, int n
sextupole strength, to make it work in a
general way, not lattice specific.
******************************************************************************************/
bool CorrectCODs(FILE *hOrbitFile, FILE *vOrbitFile, int n_orbit, int nwh, int nwv, int *hcorrIdx, int *vcorrIdx)
bool CorrectCODs(FILE *hOrbitFile, FILE *vOrbitFile, FILE *OrbScanFile, int n_orbit, int nwh, int nwv, int *hcorrIdx, int *vcorrIdx)
{
bool cod;
int i,j;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment