source: Sophya/trunk/SophyaLib/Samba/spherethetaphi.h@ 502

Last change on this file since 502 was 487, checked in by ansari, 26 years ago

suppression de sorties inutiles 21-OCT-99 GLM

File size: 4.0 KB
Line 
1#ifndef SPHERETHETAPHI_SEEN
2#define SPHERETHETAPHI_SEEN
3
4#include "sphericalmap.h"
5#include "ndatablock.h"
6#include "tvector.h"
7
8#include "anydataobj.h"
9#include "ppersist.h"
10
11// ***************** Class SphereThetaPhi *****************************
12
13template <class T>
14class SphereThetaPhi : public SphericalMap<T>, public AnyDataObj
15{
16
17public :
18
19SphereThetaPhi();
20SphereThetaPhi(int m);
21SphereThetaPhi(const SphereThetaPhi<T>& s);
22virtual ~SphereThetaPhi();
23
24// ------------ Definition of PixelMap abstract methods -
25
26/* retourne/fixe le nombre de pixels */
27virtual int NbPixels() const;
28inline void setNbPixels(int nbpix) { NPix_= nbpix; }
29
30/* retourne la valeur du pixel d'indice k */
31virtual T& PixVal(int k);
32virtual T const& PixVal(int k) const;
33
34/* retourne l'indice du pixel a (theta,phi) */
35virtual int PixIndexSph(double theta, double phi) const;
36
37/* retourne les coordonnees Spheriques du centre du pixel d'indice k */
38virtual void PixThetaPhi(int k, double& theta, double& phi) const;
39
40/* retourne/fixe l'angle Solide de Pixel (steradians) */
41virtual double PixSolAngle(int dummy) const;
42inline void setPixSolAngle(double omega) { Omega_= omega; }
43
44/* retourne/fixe la valeur du parametre de decoupage m */
45inline virtual int SizeIndex() const { return( NTheta_); }
46inline void setSizeIndex(int nbindex) { NTheta_= nbindex; }
47
48// ------------- Specific methods ----------------------
49
50virtual void Resize(int m);
51
52inline virtual char* TypeOfMap() const {return "TETAFI";};
53
54/* Valeurs de theta des paralleles et phi des meridiens limitant le pixel d'indice k */
55virtual void Limits(int k,double& th1,double& th2,double& phi1,double& phi2);
56
57/* Nombre de tranches en theta */
58int NbThetaSlices() const;
59
60/* Nombre de pixels en phi de la tranche d'indice kt */
61int NPhi(int kt) const;
62
63/* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max */
64/* de la tranche d'indice kt */
65void Theta(int kt, double& t1, double& t2);
66
67/* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp */
68/* dans la tranche d'indice kt */
69void Phi(int kt, int jp, double& p1, double& p2);
70
71/* Renvoie l'indice k du pixel d'indice jp dans la tranche d'indice kt */
72int Index(int kt, int jp) const;
73
74/* Indice kt de la tranche et indice jp du pixel d'indice k */
75void ThetaPhiIndex(int k,int& kt,int& jp);
76
77void Pixelize(int);
78
79void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const;
80
81/*retourne le tableau contenant le nombre de pixels en phi de chacune des bandes en theta */
82inline const int* getmNPhi() const { return(NPhi_); }
83void setmNPhi(int* array, int m);
84
85/* retourne/remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes */
86inline const int* getmTNphi() const { return(TNphi_); }
87void setmTNphi(int* array, int m);
88
89/* retourne/remplit le tableau contenant les valeurs limites de theta */
90inline const double* getmTheta() const { return(Theta_); }
91void setmTheta(double* array, int m);
92
93/* retourne le pointeur vers/remplit le vecteur des contenus des pixels */
94inline const NDataBlock<T>* getDataBlock() const { return (&pixels_); }
95void setDataBlock(T* data, int m);
96
97/* impression */
98void print(ostream& os) const;
99
100private :
101
102// ------------- méthodes internes ----------------------
103void InitNul();
104void Clear();
105
106// ------------- variables internes ---------------------
107int NTheta_;
108int NPix_;
109double Omega_;
110int* NPhi_;
111int* TNphi_;
112double* Theta_;
113NDataBlock<T> pixels_;
114};
115
116// ------------- Classe pour la gestion de persistance --
117template <class T>
118class FIO_SphereThetaPhi : public PPersist
119{
120public:
121
122FIO_SphereThetaPhi();
123FIO_SphereThetaPhi(string const & filename);
124FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj);
125FIO_SphereThetaPhi(SphereThetaPhi<T>* obj);
126virtual ~FIO_SphereThetaPhi();
127virtual AnyDataObj* DataObj();
128inline operator SphereThetaPhi<T>() { return(*dobj); }
129inline SphereThetaPhi<T> getObj() { return(*dobj); }
130
131protected :
132
133virtual void ReadSelf(PInPersist&);
134virtual void WriteSelf(POutPersist&) const;
135SphereThetaPhi<T>* dobj;
136bool ownobj;
137};
138
139#endif
Note: See TracBrowser for help on using the repository browser.