source: Sophya/trunk/SigPredictor/lobecartographmoyen.cc@ 1187

Last change on this file since 1187 was 1148, checked in by ansari, 25 years ago

mise a jour

File size: 1.8 KB
Line 
1 // Dominique YVON, CEA/DAPNIA/SPP 02/2000
2
3#include <math.h>
4#ifdef __MWERKS__
5
6 #include "unixmac.h"
7 #include "macenvvariables.h"
8#endif
9#include "unitvector.h"
10#include "lobecartographmoyen.h"
11
12LobeCartoMoyen::LobeCartoMoyen(CarteLobe* pcart,double freqMin, double freqMax)
13 :MeanFreqLobe(freqMin,freqMax), pCarte(pcart) {
14
15 angleMax=pCarte->halfAngAperture();
16 cosanglemax=cos(angleMax);
17 sprintf(Name,"Lobe CartographiŽ TICRA");
18}
19
20LobeCartoMoyen::~LobeCartoMoyen(){ }
21double LobeCartoMoyen::lobeResol() const{
22 // Du fait des extrapolations paraboliques, on peut calculer le lobe en
23 // tout point sans reconter de probleme de precision
24 return pCarte->resol();
25}
26
27UnitVector LobeCartoMoyen::VecShift(const UnitVector& Vpointe, const UnitVector& VY) const {
28 double alpha,beta;
29 pCarte->UVToAng(pCarte->UCentre(),pCarte->VCentre(),alpha,beta);
30 UnitVector Vec;
31 Vec=Vpointe.Rotate(VY,alpha);
32 Vec=Vec.Rotate(Vpointe,beta);
33 return Vec;
34}
35
36
37double LobeCartoMoyen::weigthAmpl(const UnitVector& Vcourant,const UnitVector& VP,
38 const UnitVector& VY) const{
39 UnitVector VCentreLobe;
40 VCentreLobe=VecShift(VP, VY);
41 double cosbidon=(Vcourant*VCentreLobe);
42 if (cosanglemax>cosbidon) return 0.;
43 else
44 //return 1.; //Debug
45 { double cosalpha=Vcourant*VP;
46 // cout<<1-cosalpha*cosalpha<<endl;
47 double sinalpha=sqrt(1-cosalpha*cosalpha); // Approx. des petits angles
48
49 Vector3d VProjVcourant;
50 VProjVcourant=Vcourant-cosalpha*VP;
51 VProjVcourant.Normalize();
52
53 UnitVector VX=VY^VP;
54 // Produit vectoriel
55 // On peut optimiser en sortant le calcul de VX de la fonction.
56 double cosbeta=VProjVcourant*VX;
57 double sinbeta=VProjVcourant*VY;
58
59 return pCarte->Value(sinalpha*cosbeta,sinalpha*sinbeta);
60 // Il faut comprendre les homogeneites de la carte BUGGGGGG XXXXXXX
61
62 }
63
64}
Note: See TracBrowser for help on using the repository browser.