Commit b6de67b9 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

Initialisation de la pente de la droite phi(fre) pour le fit a partir des...

Initialisation de la pente de la droite phi(fre) pour le fit a partir des valeurs deteremines sur des fits de phase mono-frequence, Reza, 03/03/2019
parent 673e0ba0
......@@ -614,6 +614,10 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
size_t NB_CXCORS=acxd_.getNbCrossCor();
size_t NTRK = acxd_.NbTrk();
double phi0deg_I[6] = {250. , 110, 60., 220., 170., 310.};
double aphideg_I[6] = {-71. , 383., 449., 454., 520., 66.};
cout << "======================================================================================"<<endl;
cout << "---------- ACxSetFitter::doCxfit() ; Performing cross-cor phase fit for NTrk="<<NTRK<<endl;
if (useAac) cout << " ... Using Amplitude from auto-correlations fit for initial fit parameter value..."<<endl;
......@@ -663,8 +667,8 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
mFit.SetData(&gdata); // connect data to the fitter , here the data is unused - gxi2 includes its data
mFit.SetMaxStep(3000);
// SetParam(int n,double value, double step,double min=1., double max=-1.);
mFit.SetParam(0,"Phi_0",0.5*M_PI,M_PI/360.,0.,2.2*M_PI);
mFit.SetParam(1,"a_phi",0.,0.05,-15.,15.);
mFit.SetParam(0,"Phi_0",Angle(phi0deg_I[ii],Angle::Degree).ToRadian(),M_PI/180.,-0.5*M_PI,3*M_PI);
mFit.SetParam(1,"a_phi",Angle(aphideg_I[ii],Angle::Degree).ToRadian(),0.05,-15.,15.);
if (fgphi0only) {
cout << " ACxSetFitter::doCxfit() Fitting Phi0 Only (frequency independent phase)"<<endl;
mFit.SetFix(1,0.);
......@@ -688,7 +692,10 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
}
double fparm[500]; fparm[0]=0.;
fparm[0]=Angle(phi0deg_I[ii], Angle::Degree).ToRadian(); // Angle(phi0deg_I[ii],Angle::Degree).ToRadian()
if (fgphi0only) fparm[1]=0.;
fparm[1]=Angle(aphideg_I[ii], Angle::Degree).ToRadian();;
double bestxi2 = 9.e19;
double bestphase=0.;
int bestnpts,npts;
......@@ -702,9 +709,10 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
fparm[2+3*j]=(useAac?Aac:v_amp[j]);
fparm[2+3*j]*=afact[ia]; fparm[3+3*j]=fparm[4+3*j]=0.;
}
for(double ph=0.; ph<360.; ph += 1) {
fparm[0]=Angle(ph, Angle::Degree).ToRadian();
fparm[1]=0.;
for(int jp=-1; jp<180; jp++) {
double ph = jp*2.;
if (jp==-1) fparm[0]=Angle(phi0deg_I[ii], Angle::Degree).ToRadian();
else fparm[0]=Angle(ph, Angle::Degree).ToRadian();
double xi2 = gxi2.getXi2(fparm, npts);
//DBG cout << " *DBG* ia="<<ia<<" afact="<<afact[ia]<<" ph="<<ph<<" xi2="<<xi2<<endl;
if (xi2 < bestxi2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment