Commit 475ab2ae authored by perdereau's avatar perdereau

sats : bash line in readme, larger width for good sats

public MyACSignal pour MyACGenXi2 ; init du fit des autocorr (et bornes)
changee
parent b99382b3
...@@ -77,6 +77,7 @@ Les satellites dont on telecharge les TLE sont listes dans les variables: naviga ...@@ -77,6 +77,7 @@ Les satellites dont on telecharge les TLE sont listes dans les variables: naviga
.Reza 25/11/2018 : Au CC-IN2P3, il faut ajouter l'option de compilation -std=c++11 .Reza 25/11/2018 : Au CC-IN2P3, il faut ajouter l'option de compilation -std=c++11
J'ai donc modifie le Makefile en ajoutant un flag optionnel de compilation - pour faire make au CC J'ai donc modifie le Makefile en ajoutant un flag optionnel de compilation - pour faire make au CC
> set HERESGP4 = /pbs/throng/baoradio/Library/SGP4_Code/ > set HERESGP4 = /pbs/throng/baoradio/Library/SGP4_Code/
> ou : export HERESGP4=/pbs/throng/baoradio/Library/SGP4_Code/
> make SGP4INC=${HERESGP4}/sgp4/libsgp4/ SGP4LIB=${HERESGP4}/libsgp4/ SGP4CCFLG="-std=c++11" > make SGP4INC=${HERESGP4}/sgp4/libsgp4/ SGP4LIB=${HERESGP4}/libsgp4/ SGP4CCFLG="-std=c++11"
----- -----
......
...@@ -278,7 +278,7 @@ int main(int narg, char *arg[]) ...@@ -278,7 +278,7 @@ int main(int narg, char *arg[])
cout <<" closest-los: sep="<<sepmin<<" "<<datemin<<" "<<topomin<<" "<<vsatfilename[isat]<<endl; cout <<" closest-los: sep="<<sepmin<<" "<<datemin<<" "<<topomin<<" "<<vsatfilename[isat]<<endl;
if(sepmin>sep) cout<<"WARNING: sep="<<sep<<"< sepmin="<<sepmin<<endl; if(sepmin>sep) cout<<"WARNING: sep="<<sep<<"< sepmin="<<sepmin<<endl;
if (sepmin<2.) cout << "GOOD SAT " <<satname << " " << vsatfilename[isat]<<" " << " closest-los: sep="<<sepmin<<" "<<datemin<<" "<<topomin << endl; if (sepmin<2.5) cout << "GOOD SAT " <<satname << " " << vsatfilename[isat]<<" " << " closest-los: sep="<<sepmin<<" "<<datemin<<" "<<topomin << endl;
// //
} catch (SatelliteException& e) { } catch (SatelliteException& e) {
......
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
}; };
//----------------------------------------------------------------- //-----------------------------------------------------------------
class MyACGenXi2 : public GeneralXi2, MyACSignal { class MyACGenXi2 : public GeneralXi2, public MyACSignal {
public: public:
MyACGenXi2(vector< vector<double> > & v_time_data_, vector< vector< vector<double> > > & vv_data_, MyACGenXi2(vector< vector<double> > & v_time_data_, vector< vector< vector<double> > > & vv_data_,
vector< vector< vector<double> > > & vv_err_, vector<double> & v_freqs_, vector<bool> & v_noAC_, vector< vector< vector<double> > > & vv_err_, vector<double> & v_freqs_, vector<bool> & v_noAC_,
......
...@@ -112,8 +112,8 @@ static int decode_trkcard(string const& key, string const& toks) ...@@ -112,8 +112,8 @@ static int decode_trkcard(string const& key, string const& toks)
if (ll>0) { if (ll>0) {
for(size_t l=0; l<ll; l++) sflags[l]=toupper(sflags[l]); for(size_t l=0; l<ll; l++) sflags[l]=toupper(sflags[l]);
string sflg=sflags; string sflg=sflags;
if ((sflg == "NOAC")||(sflg=="NOACCX")) noAC=true; if ((sflg == "NOAC")||(sflg=="NOACCX")||(sflg=="NOACX")) noAC=true;
if ((sflg == "NOCX")||(sflg=="NOACCX")) noCx=true; if ((sflg == "NOCX")||(sflg=="NOACCX")||(sflg=="NOACX")) noCx=true;
} }
v_noAC_p_->push_back(noAC); v_noAC_p_->push_back(noAC);
v_noCx_p_->push_back(noCx); v_noCx_p_->push_back(noCx);
...@@ -350,7 +350,7 @@ ostream & AcxDataSet::PrintACFitSummary(ostream & os) ...@@ -350,7 +350,7 @@ ostream & AcxDataSet::PrintACFitSummary(ostream & os)
os<<acnames[i]<<" D(m)= "<<setw(8)<<v_Ddish[i]<<" +/- "<<setw(8)<<v_err_Ddish[i]; os<<acnames[i]<<" D(m)= "<<setw(8)<<v_Ddish[i]<<" +/- "<<setw(8)<<v_err_Ddish[i];
os<<" Elev(deg)= "<<setw(8)<<elevdeg<<" +/- "<<setw(8)<<err_elevdeg; os<<" Elev(deg)= "<<setw(8)<<elevdeg<<" +/- "<<setw(8)<<err_elevdeg;
os<<" Azim(deg)= "<<setw(8)<<azimdeg<<" +/- "<<setw(8)<<err_azimdeg; os<<" Azim(deg)= "<<setw(8)<<azimdeg<<" +/- "<<setw(8)<<err_azimdeg;
os<<" RcFit="<<setw(6)<<v_RcFit_ac[i]<<" Xi2Red="<<setw(8)<<v_xi2red_ac[i]<<endl; os<<" RcFit="<<setw(6)<<v_RcFit_ac[i]<<" Xi2Red= "<<setw(8)<<v_xi2red_ac[i]<<endl;
} }
return os; return os;
} }
...@@ -478,7 +478,7 @@ size_t TrackSet::ReadData(TrkInputDataSet & tkds) ...@@ -478,7 +478,7 @@ size_t TrackSet::ReadData(TrkInputDataSet & tkds)
//------------------------ ACxSetFitter ------------------------------------- //------------------------ ACxSetFitter -------------------------------------
ACxSetFitter::ACxSetFitter(AcxDataSet & data, TrackSet & tks) ACxSetFitter::ACxSetFitter(AcxDataSet & data, TrackSet & tks)
: fggaussbeam_(true), D_dish(5.), acxd_(data), tks_(tks), fit_ac_done(false), fit_cx_done(false), : fggaussbeam_(true), D_dish(4.5), acxd_(data), tks_(tks), fit_ac_done(false), fit_cx_done(false),
v_RcFit_ac(tks.getNbAutoCor()), v_xi2red_ac(tks.getNbAutoCor()), v_RcFit_ac(tks.getNbAutoCor()), v_xi2red_ac(tks.getNbAutoCor()),
v_Ddish(tks.getNbAutoCor()), v_thetaant(tks.getNbAutoCor()), v_Ddish(tks.getNbAutoCor()), v_thetaant(tks.getNbAutoCor()),
v_phiant(tks.getNbAutoCor()), v_A(tks.getNbAutoCor()), v_B(tks.getNbAutoCor()), v_phiant(tks.getNbAutoCor()), v_A(tks.getNbAutoCor()), v_B(tks.getNbAutoCor()),
...@@ -549,16 +549,40 @@ int ACxSetFitter::doACfit(string outfilename) ...@@ -549,16 +549,40 @@ int ACxSetFitter::doACfit(string outfilename)
phiAntenne=Angle(90.,Angle::Degree).ToRadian(); phiAntenne=Angle(90.,Angle::Degree).ToRadian();
} }
} }
mFit.SetParam(1,"ThetaAntenne",thetaAntenne,M_PI/1440,0.,M_PI/4.); // thetaAntenne+M_PI/30.); // mFit.SetParam(1,"ThetaAntenne",thetaAntenne,M_PI/1440,0.,M_PI/4.);
mFit.SetParam(2,"PhiAntenne",phiAntenne,M_PI/180.,0.,2.*M_PI); //mFit.SetParam(1,"ThetaAntenne",thetaAntenne,M_PI/300.,thetaAntenne-15.*M_PI/180. ,thetaAntenne+15.*M_PI/180. ); // thetaAntenne+M_PI/30.); //
mFit.SetParam(2,"PhiAntenne",phiAntenne,M_PI/180.,-2.*M_PI,2.*M_PI);
// mFit.SetFix(1, thetaAntenne); // mFit.SetFix(1, thetaAntenne);
// mFit.SetFix(2, phiAntenne); // mFit.SetFix(2, phiAntenne);
//DEL size_t jj=0; //DEL size_t jj=0;
for(size_t j=0; j<NTRK; j++) { for(size_t j=0; j<NTRK; j++) {
double A = acxd_.v_max_data[j][ii];
double B = acxd_.v_min_data[j][ii]; TVector<double> expv = gxi2.getExpectedSignal(j,D_dish, thetaAntenne, phiAntenne,1. ,0.) ;
A -= B; TVector<double> datv = acxd_.vv_data[j][ii];
// je suppose que la trace est +/- centree
// base level : averages at both ends
double bb=0.;
size_t len=expv.NElts()/10;
for(size_t m=0; m<len ; m++) bb+=datv[m];
for(size_t m=expv.NElts()-len ; m<expv.NElts() ; m++) bb+=datv[m];
double B=bb/(2.*len);
// ampli : moyene au centre
double aa=0.;
double ee=0.;
for(size_t m=expv.NElts()/2-10; m<expv.NElts()/2+10 ; m++) {
aa+=datv[m]-B;
ee+=expv[m];
}
//double A = acxd_.v_max_data[j][ii];
//double B = acxd_.v_min_data[j][ii];
//A -= B;
double A=aa/ee;
if (A<1.e-9) { if (A<1.e-9) {
cout << " doACfit()/Warning NumAnt/ii="<<ii<<" NumTrk/j="<<j<<" Negative A , A="<<A<<" B="<<B<<" A->"<<0.1*B<<endl; cout << " doACfit()/Warning NumAnt/ii="<<ii<<" NumTrk/j="<<j<<" Negative A , A="<<A<<" B="<<B<<" A->"<<0.1*B<<endl;
A=0.1*B; A=0.1*B;
...@@ -568,9 +592,9 @@ int ACxSetFitter::doACfit(string outfilename) ...@@ -568,9 +592,9 @@ int ACxSetFitter::doACfit(string outfilename)
//DEL if (acxd_.v_noAC[j]) continue; //DEL if (acxd_.v_noAC[j]) continue;
char pname[32]; char pname[32];
sprintf(pname,"A%d",(int)(j+1)); sprintf(pname,"A%d",(int)(j+1));
mFit.SetParam(2*j+3,pname,A,A/10.,A/20,A*5); mFit.SetParam(2*j+3,pname,A,A/10.,A/20.,A*5);
sprintf(pname,"B%d",(int)(j+1)); sprintf(pname,"B%d",(int)(j+1));
mFit.SetParam(2*j+4,pname,B,B/10.,B/20,B*5); mFit.SetParam(2*j+4,pname,B,B/10.,B/20.,B*5);
// mFit.SetFix(2*jj+4, B); // mFit.SetFix(2*jj+4, B);
if (acxd_.v_noAC[j]) { if (acxd_.v_noAC[j]) {
mFit.SetFix(2*j+3, A); mFit.SetFix(2*j+3, A);
...@@ -578,7 +602,8 @@ int ACxSetFitter::doACfit(string outfilename) ...@@ -578,7 +602,8 @@ int ACxSetFitter::doACfit(string outfilename)
} }
//DEL jj++; //DEL jj++;
} }
//DBG mFit.PrintFit(); //DBG
mFit.PrintFit();
// cout << "do_p4_trkfit 2."<<ii+1<<" Performing the fit for AutoCor Antenna= " << ii+1 << endl; // cout << "do_p4_trkfit 2."<<ii+1<<" Performing the fit for AutoCor Antenna= " << ii+1 << endl;
int rcfit = mFit.doFit(); int rcfit = mFit.doFit();
double xi2red=mFit.GetChi2Red(); double xi2red=mFit.GetChi2Red();
...@@ -669,7 +694,7 @@ int ACxSetFitter::saveExpectedAC(string outcheckfilename) ...@@ -669,7 +694,7 @@ int ACxSetFitter::saveExpectedAC(string outcheckfilename)
size_t pp = outcheckfilename.rfind('.'); size_t pp = outcheckfilename.rfind('.');
if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) { if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) {
cout << "----- ACxSetFitter::saveExpectedAC : Saving to FITS file "<<outcheckfilename<<endl; cout << "----- ACxSetFitter::saveExpectedAC : Saving to FITS file "<<outcheckfilename<<endl;
fos=new FitsInOutFile (outcheckfilename,FitsInOutFile::Fits_Create); fos=new FitsInOutFile ("!"+outcheckfilename,FitsInOutFile::Fits_Create);
} else { } else {
pos = new POutPersist (outcheckfilename); pos = new POutPersist (outcheckfilename);
} }
...@@ -735,9 +760,9 @@ int ACxSetFitter::saveExpectedAC(string outcheckfilename) ...@@ -735,9 +760,9 @@ int ACxSetFitter::saveExpectedAC(string outcheckfilename)
//*fos<<tata ; //*fos<<tata ;
cout<<" number of extenstions "<<data_names.size()<<endl; cout<<" number of extenstions "<<data_names.size()<<endl;
for (int k=0 ; k<data_names.size() ; k++){ //for (int k=0 ; k<data_names.size() ; k++){
cout<<" no "<<k<<" ->"<<data_names[k]<<endl; // cout<<" no "<<k<<" ->"<<data_names[k]<<endl;
} //}
delete(fos); delete(fos);
} }
...@@ -984,7 +1009,7 @@ int ACxSetFitter::saveExpectedCx(string outcheckfilename) ...@@ -984,7 +1009,7 @@ int ACxSetFitter::saveExpectedCx(string outcheckfilename)
if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) { if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) {
cout << "----- ACxSetFitter::saveExpectedCx : Saving to FITS file "<<outcheckfilename<<endl; cout << "----- ACxSetFitter::saveExpectedCx : Saving to FITS file "<<outcheckfilename<<endl;
fox=new FitsInOutFile (outcheckfilename,FitsInOutFile::Fits_Create); fox=new FitsInOutFile ("!"+outcheckfilename,FitsInOutFile::Fits_Create);
} else { } else {
pox = new POutPersist (outcheckfilename); pox = new POutPersist (outcheckfilename);
} }
...@@ -1055,9 +1080,9 @@ int ACxSetFitter::saveExpectedCx(string outcheckfilename) ...@@ -1055,9 +1080,9 @@ int ACxSetFitter::saveExpectedCx(string outcheckfilename)
if (fox!=NULL) { if (fox!=NULL) {
cout<<" number of extensions "<<data_names.size()<<endl; cout<<" number of extensions "<<data_names.size()<<endl;
for (int k=0 ; k<data_names.size() ; k++){ //for (int k=0 ; k<data_names.size() ; k++){
cout<<" no "<<k<<" ->"<<data_names[k]<<endl; // cout<<" no "<<k<<" ->"<<data_names[k]<<endl;
} //}
delete(fox); delete(fox);
...@@ -1396,7 +1421,7 @@ int CxBaselineFitter::saveExpectedCx(string outcheckfilename) ...@@ -1396,7 +1421,7 @@ int CxBaselineFitter::saveExpectedCx(string outcheckfilename)
size_t pp = outcheckfilename.rfind('.'); size_t pp = outcheckfilename.rfind('.');
if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) { if ((pp<ll)&&(outcheckfilename.substr(pp)==".fits")) {
cout << "----- CxBaselineFitter::saveExpectedCx : Saving to FITS file "<<outcheckfilename<<endl; cout << "----- CxBaselineFitter::saveExpectedCx : Saving to FITS file "<<outcheckfilename<<endl;
fox = new FitsInOutFile (outcheckfilename,FitsInOutFile::Fits_Create); fox = new FitsInOutFile ("!"+outcheckfilename,FitsInOutFile::Fits_Create);
} else { } else {
pox = new POutPersist (outcheckfilename); pox = new POutPersist (outcheckfilename);
} }
...@@ -1462,9 +1487,9 @@ int CxBaselineFitter::saveExpectedCx(string outcheckfilename) ...@@ -1462,9 +1487,9 @@ int CxBaselineFitter::saveExpectedCx(string outcheckfilename)
if (pox!=NULL) delete(pox); if (pox!=NULL) delete(pox);
if (fox!=NULL) { if (fox!=NULL) {
cout<<" number of extenstions "<<data_names.size()<<endl; cout<<" number of extenstions "<<data_names.size()<<endl;
for (int k=0 ; k<data_names.size() ; k++){ //for (int k=0 ; k<data_names.size() ; k++){
cout<<" no "<<k<<" ->"<<data_names[k]<<endl; // cout<<" no "<<k<<" ->"<<data_names[k]<<endl;
} //}
delete(fox); delete(fox);
} }
return 0; return 0;
......
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