| 1 | #ifndef SPHERETHETAPHI_SEEN
|
|---|
| 2 | #define SPHERETHETAPHI_SEEN
|
|---|
| 3 |
|
|---|
| 4 | #include "sphericalmap.h"
|
|---|
| 5 | #include "pdataarray.h"
|
|---|
| 6 | #include "cvector.h"
|
|---|
| 7 |
|
|---|
| 8 | // ***************** CLASSE SphereThetaPhi *****************************
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | class SphereThetaPhi : public SphericalMap {
|
|---|
| 12 | public :
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | SphereThetaPhi(int_4 m, int_4 pet);
|
|---|
| 16 | SphereThetaPhi();
|
|---|
| 17 | SphereThetaPhi(char* flnm);
|
|---|
| 18 | virtual ~SphereThetaPhi();
|
|---|
| 19 |
|
|---|
| 20 | // ------------ Persistence handling
|
|---|
| 21 |
|
|---|
| 22 | enum {classId = 0xF001 };
|
|---|
| 23 | int_4 ClassId() const { return classId; }
|
|---|
| 24 |
|
|---|
| 25 | virtual void WriteSelf(POutPersist&) const;
|
|---|
| 26 | virtual void ReadSelf(PInPersist&);
|
|---|
| 27 |
|
|---|
| 28 | // ------------------ Definition of PixelMap abstract methods
|
|---|
| 29 |
|
|---|
| 30 | // number of pixels
|
|---|
| 31 | virtual int_4 NbPixels() const;
|
|---|
| 32 |
|
|---|
| 33 | // Value of pixel number k
|
|---|
| 34 | virtual r_8& PixVal(int_4 k);
|
|---|
| 35 | virtual r_8 const& PixVal(int_4 k) const;
|
|---|
| 36 |
|
|---|
| 37 | // Index of pixel at (theta,phi)
|
|---|
| 38 | virtual int_4 PixIndexSph(float theta, float phi) const;
|
|---|
| 39 |
|
|---|
| 40 | // Spherical coordinates of center of pixel number k
|
|---|
| 41 | virtual void PixThetaPhi(int_4 k, float& theta, float& phi) const;
|
|---|
| 42 |
|
|---|
| 43 | // Pixel Solid angle (steradians)
|
|---|
| 44 | virtual r_8 PixSolAngle(int_4 dummy) const;
|
|---|
| 45 | // --------------- Specific methods
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | /* Valeurs de theta des paralleles et phi des meridiens limitant */
|
|---|
| 49 | /* le pixel d'indice k */
|
|---|
| 50 | virtual void Limits(int_4 k, float& tet1, float& tet2,
|
|---|
| 51 | float& phi1, float& phi2 );
|
|---|
| 52 |
|
|---|
| 53 | /* Nombre de tranches en theta */
|
|---|
| 54 | int_4 NbThetaSlices() const;
|
|---|
| 55 |
|
|---|
| 56 | /* Nombre de pixels en phi de la tranche d'indice kt */
|
|---|
| 57 | int_4 NPhi(int_4 kt) const;
|
|---|
| 58 |
|
|---|
| 59 | /* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max */
|
|---|
| 60 | /* de la tranche d'indice kt */
|
|---|
| 61 | void Theta(int_4 kt, float& t1, float& t2);
|
|---|
| 62 |
|
|---|
| 63 | /* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp */
|
|---|
| 64 | /* dans la tranche d'indice kt */
|
|---|
| 65 | void Phi(int_4 kt, int_4 jp, float& p1, float& p2);
|
|---|
| 66 |
|
|---|
| 67 | /* Renvoie l'indice k du pixel d'indice jp dans la tranche d'indice kt */
|
|---|
| 68 | int_4 Index(int_4 kt, int_4 jp) const;
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | /* Indice kt de la tranche et indice jp du pixel d'indice k */
|
|---|
| 72 | void ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp);
|
|---|
| 73 |
|
|---|
| 74 | void Pixelize(int_4,int_4);
|
|---|
| 75 | void GetThetaSlice(int_4 index, r_4& theta, Vector& phi, Vector& value) const;
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | private :
|
|---|
| 79 | // ------------- méthodes internes ----------------------
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | void InitNul();
|
|---|
| 83 | void Clear();
|
|---|
| 84 |
|
|---|
| 85 | // ------------- variables internes -----------------------
|
|---|
| 86 | int_4 mNTheta,mNPet;
|
|---|
| 87 | int_4 mNPix;
|
|---|
| 88 | r_4* mTheta;
|
|---|
| 89 | r_8 mOmeg;
|
|---|
| 90 | int_4* mNphi;
|
|---|
| 91 | int_4* mTNphi;
|
|---|
| 92 | //r_8* mPix;
|
|---|
| 93 | PDataArray<r_8>* _pixel;
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | };
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 | #endif
|
|---|