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

Modifs / corrections mineures diverses, changement du defaut / argument du...

Modifs / corrections mineures diverses, changement du defaut / argument du programme -cxB0 en -cxfB (fit B if -cxfB specifie), Reza 04/04/2019
parent b6de67b9
......@@ -211,17 +211,17 @@ Sources avec observation vers CasA (z=+11.42)
@trk dt_LD14jan19 1460,1500 1278.5 trk_43566_20190115
@trk dt_LD14jan19 2455,2495 1278.5 trk_43055_20190115
# Sky at 1346 MHz
@trk dtsky1346_LD14jan19 920,960 1346 CasA_survey_2019-1-14
@trk dtsky1346_LD14jan19 2355,2395 1346 CasA_survey_2019-1-15
@trk dtsky1346_LD14jan19 3790,3830 1346 CasA_survey_2019-1-16
@trk dtsky1346_LD14jan19 920,960 1346 CasA_survey_2019-1-14 NOAC
@trk dtsky1346_LD14jan19 2355,2395 1346 CasA_survey_2019-1-15 NOAC
@trk dtsky1346_LD14jan19 3790,3830 1346 CasA_survey_2019-1-16 NOAC
# Sky at 1396 MHz
@trk dtsky1396_LD14jan19 920,960 1396 CasA_survey_2019-1-14
@trk dtsky1396_LD14jan19 2355,2395 1396 CasA_survey_2019-1-15
@trk dtsky1396_LD14jan19 3790,3830 1396 CasA_survey_2019-1-16
@trk dtsky1396_LD14jan19 920,960 1396 CasA_survey_2019-1-14 NOAC
@trk dtsky1396_LD14jan19 2355,2395 1396 CasA_survey_2019-1-15 NOAC
@trk dtsky1396_LD14jan19 3790,3830 1396 CasA_survey_2019-1-16 NOAC
# Sky at 1416 MHz
@trk dtsky1416_LD14jan19 920,960 1416 CasA_survey_2019-1-14
@trk dtsky1416_LD14jan19 2355,2395 1416 CasA_survey_2019-1-15
@trk dtsky1416_LD14jan19 3790,3830 1416 CasA_survey_2019-1-16
@trk dtsky1416_LD14jan19 920,960 1416 CasA_survey_2019-1-14 NOAC
@trk dtsky1416_LD14jan19 2355,2395 1416 CasA_survey_2019-1-15 NOAC
@trk dtsky1416_LD14jan19 3790,3830 1416 CasA_survey_2019-1-16 NOAC
#### ldtrk_cygA.d
--- Observation Longue duree Janvier 2019
......@@ -229,12 +229,15 @@ Sources avec observation vers CygA (z=-6.5)
@zenang -6.
@trk dt_LD14jan19 4130,4175 1278.5 trk_43057_20190116
@trk dt_LD14jan19 6120,6160 1278.5 trk_41175_20190118
@trk dtsky1346_LD14jan19 5025,5065 1346 CygA_survey_2019-1-17
@trk dtsky1346_LD14jan19 6460,6500 1346 CygA_survey_2019-1-18
@trk dtsky1396_LD14jan19 5025,5065 1396 CygA_survey_2019-1-17
@trk dtsky1396_LD14jan19 6460,6500 1396 CygA_survey_2019-1-18
@trk dtsky1416_LD14jan19 5025,5065 1416 CygA_survey_2019-1-17
@trk dtsky1416_LD14jan19 6460,6500 1416 CygA_survey_2019-1-18
# Sky at 1346 MHz
@trk dtsky1346_LD14jan19 5025,5065 1346 CygA_survey_2019-1-17 NOAC
@trk dtsky1346_LD14jan19 6460,6500 1346 CygA_survey_2019-1-18 NOAC
# Sky at 1396 MHz
@trk dtsky1396_LD14jan19 5025,5065 1396 CygA_survey_2019-1-17 NOAC
@trk dtsky1396_LD14jan19 6460,6500 1396 CygA_survey_2019-1-18 NOAC
# Sky at 1416 MHz
@trk dtsky1416_LD14jan19 5025,5065 1416 CygA_survey_2019-1-17 NOAC
@trk dtsky1416_LD14jan19 6460,6500 1416 CygA_survey_2019-1-18 NOAC
#### ldtrk_virA.d
--- Observation Longue duree Janvier 2019
......@@ -250,12 +253,18 @@ ${PRGBASE}/Objs/trkacxfit -docx6s -docx6f -D 4.5 -out ldj.txt -ckf ldj.ppf ldtrk
# Ou
${PRGBASE}/Objs/trkacxfit -docx6s -docx6f -D 4.5 -out casA.txt -ckf casA.ppf ldtrk_casA.d
${PRGBASE}/Objs/trkacxfit -nocxf -D 4.5 -out casA.txt -ckf casA.ppf ldtrk_casA.d
set nom = casA
${PRGBASE}/Objs/trkacxfit -nocxf -D 4.5 -out ${nom}.txt -ckf ${nom}.ppf ldtrk_${nom}.d
${PRGBASE}/Objs/trkacxfit -D 4.5-out ${nom}.txt -ckf ${nom}.ppf lds_${nom}.d
rm *_${nom}.txt *_${nom}.ppf
${PRGBASE}/Objs/trkacxfit -phifreq -D 4.5 -out ${nom}.txt -ckf ${nom}.ppf ldtrk_${nom}.d
#### Utiliser le script piapp : ckfitres.pic et les scripts definis dedans pour verifier les resultats
piapp> exec ckfitres.pic cxb6_casA.ppf
piapp> set nom casA
piapp> exec ckfitres.pic cxb6_${nom}.ppf
piapp> ck6 1 1
piapp> ck6 1 2
piapp> ckacx casA 1 3
piapp> ckacx casA 1 3
piapp> ckacx $nom 1 3
piapp> ckacx $nom 1 3
......@@ -90,7 +90,8 @@ static string default_input_path;
static vector<string> trksetfiles; // datacard files defining the track/data sets
static bool do_cxfit = true ; // if false, perform AutoCor fit only
static bool fg_cxB0 = false ; // if true, fix offset B to zero (complex(0,0)) when fitting cross-correlations
// fg_cxB0: if true, fix offset B to zero (complex(0,0)) when fitting cross-correlations , false : fit B0
static bool fg_cxB0 = true ; // if false, fit the offset B when fitting cross-correlations
static bool fg_phi0only = true; // if false, linear varying phase with frequency, in AutoCor and Cross-Cor fits
// ---- fit simultane sur les 6 cross-correlations
......@@ -200,7 +201,7 @@ int decode_args(int narg, char* arg[])
cout << " trkacxfit : fit array geometry and \n"
<< " Usage: trkacxfit [-options] track_Set_1 [track_Set_2] [track_Set_3 ...] \n"
<< " options: -inp def_input_path -out OutFileName -ckf CheckFileName \n"
<< " -nocxf -cxB0 -phifreq -docx6f -fixb -docx6s \n"
<< " -nocxf -cxfB -phifreq -docx6f -fixb -docx6s \n"
<<" -D dish_diameter -ngb -prt PrintLevel \n"<<endl;
if (!fglonghelp) {
cout << " trkacxfit -h to get option description " << endl;
......@@ -213,7 +214,7 @@ int decode_args(int narg, char* arg[])
<< " Output file names are constructed from OutFileName and CheckFileName prepending \n"
<< " ac_JJ_ or cx_JJ_ where JJ=1...n is the track_set number \n"
<< " -nocxf : Don't perform fit on cross-cor (AutoCor only fit) - default YES -> DO Cx fits) \n"
<< " -cxB0 : Fix the visibility offset B to zero (complex(0,0)) for cross-cor fitting - default NO -> fit B0 \n"
<< " -cxfB : Fit the offset B when fitting cross-cor (default NO -> fix B0=complex(0,0)) \n"
<< " -phifreq : Use linearly varying phase with frequency model - default No fixed Phi=Phi0 \n"
<<" Linear phi model : Phi(freq)=Phi_0 + a_Phi*(freq-1250)/250 \n"
<< " -docx6f : Perform simultaneous fit over 6 cross-corr (baseline and phases determination) - default NO \n"
......@@ -237,7 +238,7 @@ int decode_args(int narg, char* arg[])
do_baselinefit=false;
fg_fixbaseline=false;
do_baselinesimplex=false;
fg_cxB0=false;
fg_cxB0=true;
vector<string> lastargs;
while (narg>1) {
......@@ -252,8 +253,8 @@ int decode_args(int narg, char* arg[])
else if (fbo=="-nocxf") { // DON'T FIT Cross-Correlations
do_cxfit=false; arg++; narg--; lastargs.clear();
}
else if (fbo=="-cxB0") { // Fix B = 0 when fitting Cross-cor
fg_cxB0=true; arg++; narg--; lastargs.clear();
else if (fbo=="-cxfB") { // Determine B when fitting Cross-cor
fg_cxB0=false; arg++; narg--; lastargs.clear();
}
else if (fbo=="-phifreq") { // Use linear model for phase(frequency) - If not Phi(freq) = Phi0
fg_phi0only=false; arg++; narg--; lastargs.clear();
......@@ -298,7 +299,7 @@ int decode_args(int narg, char* arg[])
cout << " OutFileName= "<<outfilename<<" CheckFileName= "<<checkfilename<<endl;
cout << " Perform fits on cross-correlations ? " << (do_cxfit?"Yes":"No")
<< " Phase model : Phase(freq)= " << (fg_phi0only?"Phi0":"Phi0+aPhi*(freq-1250)/250")
<< " Fix B0 to zero ? "<<(fg_cxB0?"Yes":"No")<<endl;
<< " Fit B0 ? "<<(fg_cxB0?"No (B=(0,0)":"Yes")<<endl;
cout << " Perform baseline fit ? " << (do_baselinefit?"Yes":"No")
<<(fg_fixbaseline?" With FIXED baselines":" (Phases & baselines)")
<<" Simplex-Minimisation ? "<<(do_baselinesimplex?"Yes":"No")<<endl;
......
......@@ -615,6 +615,7 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
size_t NTRK = acxd_.NbTrk();
//------ Valeurs de phases et pente de Phi(freq) = Phi0 + aPhi * (freq-1250.)/250. (en degres)
double phi0deg_I[6] = {250. , 110, 60., 220., 170., 310.};
double aphideg_I[6] = {-71. , 383., 449., 454., 520., 66.};
......@@ -691,16 +692,17 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
v_amp[j]=A;
}
double fparm[500]; fparm[0]=0.;
double fparm[100]; 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();;
else fparm[1]=Angle(aphideg_I[ii], Angle::Degree).ToRadian();;
double bestxi2 = 9.e19;
double bestphase=0.;
int bestnpts,npts;
int bestafact;
double afact[12]={0.15,0.3,0.5,0.75,1.0,1.25,1.5,1.75,2.0,2.4,2.8,3.2};
bool fg_ph_I=false; // if true , phase value from phi0deg_I aphideg_I
for(int ia=0; ia<12; ia++) {
for(size_t j=0; j<NTRK; j++) {
double Aac=sqrt(v_A[Anum1[ii]][j] * v_A[Anum2[ii]][j]);
......@@ -716,13 +718,15 @@ int ACxSetFitter::doCxfit(string outfilenamecx, bool useAac, bool fg_B0, bool fg
double xi2 = gxi2.getXi2(fparm, npts);
//DBG cout << " *DBG* ia="<<ia<<" afact="<<afact[ia]<<" ph="<<ph<<" xi2="<<xi2<<endl;
if (xi2 < bestxi2) {
if (jp==-1) fg_ph_I=true; else fg_ph_I=false;
bestxi2 = xi2; bestphase=fparm[0]; bestnpts=npts; bestafact=afact[ia];
}
}
}
mFit.SetParam(0,"Phi_0",bestphase,M_PI/720.,-0.5*M_PI,2.5*M_PI);
cout << "2."<<ii+1<<" Scan param bestxi2_red="<<bestxi2/(double)(tot_npoints_fit-(1+NTRK))<<" bestphase="
<<Angle(bestphase).ToDegree()<<" bestnpts="<<bestnpts<<" bestafact="<<bestafact<< " A= ";
cout << "2."<<ii+1<<" Scan param bestxi2_red="<<bestxi2/(double)(tot_npoints_fit-(2+NTRK))
<<" bestphase="<<Angle(bestphase).ToDegree()<<(fg_ph_I?" (Phase from phi0deg_I)":" ")
<<" bestnpts="<<bestnpts<<" bestafact="<<bestafact<< " A= ";
v_phi_0[ii]=bestphase;
for(size_t j=0; j<NTRK; j++) {
cout << v_amp[j] << " , ";
......
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