Commit 7c72b44d authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

debug plantage fit cx-cor, Reza 22/02/2019

parent 0e412981
......@@ -540,13 +540,15 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac)
size_t NTRK = acxd_.NbTrk();
cout << "======================================================================================"<<endl;
cout << "---------- ACxSetFitter::doCxfit() ; Performing cross-cor phase fit ..."<<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;
ofstream ofr(outfilenamecx.c_str());
ofr << "#### cross-cor phase fit (ACxSetFitter::doCxfit() ) "<<endl
<< "## NumCxCor RcFit Xi2red Phase err_Phase (deg) A0 err_A0 A1 err_A1 ..."<<endl;
int tot_npoints_fit = 0;
for(size_t j=0; j<NTRK; j++) tot_npoints_fit += 2*(acxd_.v_time_data[j].size());
cout << " Total number of data points for fit="<< tot_npoints_fit<<endl;
size_t Anum1[6]={0,0,0,1,1,2};
size_t Anum2[6]={1,2,3,2,3,3};
for(size_t ii=0; ii<NB_CXCORS; ii++) {
......@@ -569,7 +571,8 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac)
gdata.AddData1(acxd_.v_time_data[j][k],v_cxdata[ii][k].real(),v_cxerr[ii][k]); // Fill x, y and error on y
gdata.AddData1(acxd_.v_time_data[j][k],v_cxdata[ii][k].imag(),v_cxerr[ii][k]); // Fill x, y and error on y
}
}
}
cout << " *DBG* filled gdata " << endl;
double clight = PhysQty::c().SIValue();
double lambda = clight/(acxd_.v_freqs[0]*1.e6);
ACBeam acb1(v_Ddish[Anum1[ii]], v_thetaant[Anum1[ii]], v_phiant[Anum1[ii]], lambda);
......@@ -811,8 +814,6 @@ int CxBaselineFitter::dofit(string outfilename, bool fgfixbaseline)
vector< vector< complex<double> > > & v_cxdata = v_acxd[i].vv_cxdata[j];
vector< vector<double> > & v_cxerr = v_acxd[i].vv_cxerr[j];
for(size_t l=0; l<v_acxd[i].v_time_data[j].size(); l++) {
double xg=v_acxd[i].v_time_data[j][l];
double yg=v_cxdata[kcx][l].real();
gdata.AddData1(v_acxd[i].v_time_data[j][l],v_cxdata[kcx][l].real(),v_cxerr[kcx][l]); // Fill x, y and error on y
gdata.AddData1(v_acxd[i].v_time_data[j][l],v_cxdata[kcx][l].imag(),v_cxerr[kcx][l]); // Fill x, y and error on y
npoints2+=2;
......
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