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

Ajout impression summary des fits de phases sur les cross-cor, Reza 04/04/2019

parent ea556df5
......@@ -147,6 +147,14 @@ int main (int narg, char* arg[])
v_trk.push_back(tks);
}
if (do_cxfit) { // Resume resultat fit cross-cor
cout<<" ---------- Summary phase fitting for cross-correlations ---------- " << endl;
for(size_t i=0; i<v_acxd.size(); i++) {
cout << "================================= TrackSet["<<i+1<<"] ================================="<<endl;
v_acxd[i].PrintCxPhaseFitSummary(cout);
}
cout<<"=================================================================================="<<endl;
}
if (do_baselinefit || do_baselinesimplex) { // fit simultane des 6 cross-cor
string cxbofile = "cxb6_"+outfilename;
string cxbckfile = "cxb6_"+checkfilename;
......
......@@ -297,6 +297,26 @@ size_t AcxDataSet::ReadData(TrkInputDataSet & tkds)
return tot_npoints;
}
ostream & AcxDataSet::PrintCxPhaseFitSummary(ostream & os)
{
const char* cxnames[6]={"Cx-1x2","Cx-1x3","Cx-1x4","Cx-2x3","Cx-2x4","Cx-3x4"};
os << "--------- Fitted phases @1300 MHz ";
for(size_t i=0; i<getNbCrossCor(); i++) os<<setw(8)<<Angle(v_phase[i]).ToDegree()<<" ; "; cout<<endl;
double dphi23=v_phase[1]-v_phase[0]; if (dphi23<0.) dphi23+=(2.*M_PI);
double dphi24=v_phase[2]-v_phase[0]; if (dphi24<0.) dphi24+=(2.*M_PI);
double dphi34=v_phase[2]-v_phase[1]; if (dphi34<0.) dphi34+=(2.*M_PI);
os << "--- Compatibility of fitted phases (@1300 MHz) among the six Baselines "<<endl;
os<<" Cx-2x3: Phi3-Phi2= "<<setw(6)<<Angle(dphi23).ToDegree()<<" EqualTo? Phi23= "<<setw(6)<<Angle(v_phase[3]).ToDegree()<<endl;
os<<" Cx-2x4: Phi4-Phi2= "<<setw(6)<<Angle(dphi24).ToDegree()<<" EqualTo? Phi24= "<<setw(6)<<Angle(v_phase[4]).ToDegree()<<endl;
os<<" Cx-3x4: Phi4-Phi3= "<<setw(6)<<Angle(dphi34).ToDegree()<<" EqualTo? Phi34= "<<setw(6)<<Angle(v_phase[5]).ToDegree()<<endl;
os << "--------- Fitted Parameters and errors ( Phi(freq)=phi0+a_phi*(freq-1250.)/250. "<<endl;
for(size_t i=0; i<getNbCrossCor(); i++) {
os<<cxnames[i]<<" phi0= "<<setw(8)<<Angle(v_phi_0[i]).ToDegree()<<" +/- "<<setw(8)<<Angle(v_err_phi_0[i]).ToDegree()
<<" a_phi= "<<setw(8)<<Angle(v_a_phi[i]).ToDegree()<<" +/- "<<setw(8)<<Angle(v_err_a_phi[i]).ToDegree()<<endl;
}
return os;
}
//------------------------ TrackSet -------------------------------------
TrackSet::TrackSet(TrackSet const & a)
......@@ -824,6 +844,8 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
acxd_.v_phase=v_phase;
acxd_.v_phi_0=v_phi_0;
acxd_.v_a_phi=v_a_phi;
acxd_.v_err_phi_0=v_err_phi_0;
acxd_.v_err_a_phi=v_err_a_phi;
acxd_.v_Acx=v_Acx;
acxd_.v_Bcx=v_Bcx;
return 0;
......
......@@ -73,6 +73,8 @@ public:
static inline size_t getNbAutoCor() { return 4; }
static inline size_t getNbCrossCor() { return 6; }
ostream & PrintCxPhaseFitSummary(ostream & os);
vector< vector<double> > v_time_data;
vector< vector< vector<double> > > vv_data;
vector< vector< vector<double> > > vv_err;
......@@ -91,9 +93,11 @@ public:
vector< CxBeam > v_acbeams; // the four aut-correlations beams after fit
vector< CxBeam > v_cxbeams; // the six cross correlations after fit
vector<double> v_phase; // fitted phases for individual cross-correlations at reference frequency
vector<double> v_phi_0; // fitted phases (Phi0) for individual cross-correlations
vector<double> v_a_phi; // fitted phases (a_phi = slope with frequency) for individual cross-correlations
vector<double> v_phase; // fitted phases for individual cross-correlations at reference frequency - reference frequency = 1300 MHz
vector<double> v_phi_0; // fitted phases zero-point (Phi0) for individual cross-correlations
vector<double> v_a_phi; // fitted phases slope (a_phi = slope with frequency) for individual cross-correlations
vector<double> v_err_phi_0; // Error on fitted phases (Phi0) for individual cross-correlations
vector<double> v_err_a_phi; // Error on fitted phases slope for individual cross-correlations
vector< vector<double> > v_Acx; // Amplitudes for the six cross-cors after fit
vector< vector< complex<double> > > v_Bcx; // Offset for the six cross-cors after fit
};
......
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