Commit 419d9472 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

Implementation interpolation azimuth avec controle passage de 360 -> 0 deg,...

Implementation interpolation azimuth avec controle passage de 360 -> 0 deg, gestion decodage arguments ds trkacfit.cc , Reza 19/12/2018
parent c825239b
......@@ -7,7 +7,8 @@
#include "generalfit.h"
#include "simplex.h"
#include "sunitpcst.h"
#include "acbeam.h"
static int debug_galfit=0;
......@@ -16,14 +17,18 @@ static int debug_galfit=0;
class MyACSignal {
public:
MyACSignal(vector< vector<double> > & v_time_data_, vector< vector< vector<double> > > & vv_data_,
vector< vector< vector<double> > > & vv_err_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_cphi_,
size_t nac=0, double lambda=0.23, bool fggauss_beam=true)
: v_time_data(v_time_data_), vv_data(vv_data_), vv_err(vv_err_),
v_interp_elev(v_interp_elev_), v_interp_cphi(v_interp_cphi_),
nac_(nac), lambda_(lambda), fggauss_beam_(fggauss_beam)
vector< vector< vector<double> > > & vv_err_, vector<double> & v_freqs_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_sazim_,
size_t nac=0, bool fggauss_beam=true)
: v_time_data(v_time_data_), vv_data(vv_data_), vv_err(vv_err_), v_freqs(v_freqs_),
v_interp_elev(v_interp_elev_), v_interp_sazim(v_interp_sazim_),
nac_(nac), fggauss_beam_(fggauss_beam)
{
cout << " MyACSignal() Antenna=nac+1= "<<nac_+1<<" NPar="<< 3+2*v_time_data_.size() << endl;
double clight = PhysQty::c().SIValue();
v_lambdas.resize(v_freqs.size());
for(size_t k=0; k<v_freqs.size(); k++)
v_lambdas[k] = clight/(v_freqs[k]*1.e6);
}
virtual int getDataSignal(size_t j, vector<double> & sig)
......@@ -54,11 +59,15 @@ public:
for(size_t k=0; k<vtime.size(); k++) {
double elev=v_interp_elev[j].YInterp(vtime[k]);
double thetasrc=Angle(90.-elev,Angle::Degree).ToRadian();
double phisrc=acos(v_interp_cphi[j].YInterp(vtime[k]));
if (phisrc<0.) phisrc+=Angle::TwoPiCst();
ACBeam beam(D_dish, theta_b, phi_b, lambda_);
double sazim=v_interp_sazim[j].YInterp(vtime[k]);
while (sazim > 360.) sazim -= 360.;
double phisrcdeg = 90.-sazim;
if (phisrcdeg < 0.) phisrcdeg+=360.;
// double phisrc=acos(v_interp_cphi[j].YInterp(vtime[k]));
// if (phisrc<0.) phisrc+=Angle::TwoPiCst();
ACBeam beam(D_dish, theta_b, phi_b, v_lambdas[j]);
beam.setGaussianLobe(fggauss_beam_);
double acb=beam.Value(thetasrc, phisrc);
double acb=beam.Value(thetasrc, Angle(phisrcdeg,Angle::Degree).ToRadian());
sig[k] = A*acb+B;
//DBG cout << " *DBG* "<<k<<" Theta,Phi-src = " << Angle(thetasrc).ToDegree() << " , " << Angle(phisrc).ToDegree()
//DBG << " elev="<<elev<<" phisrc="<<Angle(phisrc).ToDegree()<<" --> acb= "<<acb<< " sig="<<sig[k]<<endl;
......@@ -115,10 +124,11 @@ public:
vector< vector<double> > & v_time_data;
vector< vector< vector<double> > > & vv_data;
vector< vector< vector<double> > > & vv_err;
vector<double> & v_freqs;
vector<double> v_lambdas;
vector< SLinInterp1D > & v_interp_elev;
vector< SLinInterp1D > & v_interp_cphi;
vector< SLinInterp1D > & v_interp_sazim;
size_t nac_;
double lambda_;
bool fggauss_beam_;
};
......@@ -126,11 +136,11 @@ public:
class MyACGenXi2 : public GeneralXi2, MyACSignal {
public:
MyACGenXi2(vector< vector<double> > & v_time_data_, vector< vector< vector<double> > > & vv_data_,
vector< vector< vector<double> > > & vv_err_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_cphi_,
size_t nac=0, double lambda=0.23, bool fggauss_beam=true)
vector< vector< vector<double> > > & vv_err_, vector<double> & v_freqs_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_sazim_,
size_t nac=0, bool fggauss_beam=true)
: GeneralXi2(3+2*v_time_data_.size()) ,
MyACSignal(v_time_data_, vv_data_, vv_err_, v_interp_elev_, v_interp_cphi_, nac, lambda, fggauss_beam)
MyACSignal(v_time_data_, vv_data_, vv_err_, v_freqs_, v_interp_elev_, v_interp_sazim_, nac, fggauss_beam)
{
}
......@@ -151,11 +161,11 @@ public:
class MyACMinZ : public MinZFunction, MyACSignal {
public:
MyACMinZ(vector< vector<double> > & v_time_data_, vector< vector< vector<double> > > & vv_data_,
vector< vector< vector<double> > > & vv_err_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_cphi_,
size_t nac=0, double lambda=0.23, bool fggauss_beam=true)
vector< vector< vector<double> > > & vv_err_, vector<double> & v_freqs_,
vector< SLinInterp1D > & v_interp_elev_, vector< SLinInterp1D > & v_interp_sazim_,
size_t nac=0, bool fggauss_beam=true)
: MinZFunction(3+2*v_time_data_.size()) ,
MyACSignal(v_time_data_, vv_data_, vv_err_, v_interp_elev_, v_interp_cphi_, nac, lambda, fggauss_beam)
MyACSignal(v_time_data_, vv_data_, vv_err_, v_freqs_, v_interp_elev_, v_interp_sazim_, nac, fggauss_beam)
{
}
virtual double Value(double const parm[])
......
This diff is collapsed.
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