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

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

suppression de sorties inutiles 21-OCT-99 GLM

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