| [764] | 1 | #ifndef SPHERICALMAP_SEEN | 
|---|
|  | 2 | #define SPHERICALMAP_SEEN | 
|---|
|  | 3 |  | 
|---|
|  | 4 | // valeurs de Pi, 2*Pi, etc | 
|---|
|  | 5 | #include "smathconst.h" | 
|---|
|  | 6 | #include <math.h> | 
|---|
|  | 7 | #include "pixelmap.h" | 
|---|
|  | 8 | #include "tvector.h" | 
|---|
|  | 9 |  | 
|---|
|  | 10 | // Map of pixels on a whole sphere. | 
|---|
|  | 11 | // Class hierarchy : | 
|---|
|  | 12 | //   PixelMap | 
|---|
|  | 13 | //      SphericalMap | 
|---|
|  | 14 | //         SphereThetaPhi | 
|---|
|  | 15 | //         SphereGorski | 
|---|
|  | 16 | //         SphereIco | 
|---|
|  | 17 | //      LocalMap | 
|---|
|  | 18 |  | 
|---|
| [908] | 19 |  | 
|---|
|  | 20 |  | 
|---|
|  | 21 |  | 
|---|
|  | 22 | namespace SOPHYA { | 
|---|
|  | 23 |  | 
|---|
| [1371] | 24 | /*! | 
|---|
| [1375] | 25 | \class SphericalMap | 
|---|
| [1371] | 26 | \ingroup SkyMap | 
|---|
|  | 27 | Base class (pure virtual) for 4Pi spherical maps | 
|---|
|  | 28 | */ | 
|---|
| [908] | 29 |  | 
|---|
| [764] | 30 | template<class T> | 
|---|
|  | 31 | class SphericalMap : public PixelMap<T> | 
|---|
|  | 32 | { | 
|---|
|  | 33 |  | 
|---|
|  | 34 | public : | 
|---|
|  | 35 |  | 
|---|
|  | 36 | SphericalMap() {}; | 
|---|
|  | 37 | virtual  ~SphericalMap() {}; | 
|---|
|  | 38 |  | 
|---|
|  | 39 | // Overloading of () to access pixel number k. | 
|---|
| [2885] | 40 | inline T& operator()(int k) {return(this->PixVal(k));} | 
|---|
|  | 41 | inline T  const& operator()(int k) const {return(this->PixVal(k));} | 
|---|
|  | 42 | inline T& operator()(double theta,double phi) {return(this->PixValSph(theta,phi));}; | 
|---|
|  | 43 | inline T  const& operator()(double theta,double phi) const {return(this->PixValSph(theta,phi));}; | 
|---|
| [764] | 44 |  | 
|---|
|  | 45 | // index characterizing the size pixelization : m for SphereThetaPhi | 
|---|
|  | 46 | // nside for Gorski sphere... | 
|---|
| [783] | 47 | virtual void Resize(int_4 m)=0; | 
|---|
| [764] | 48 | virtual uint_4 NbThetaSlices() const=0; | 
|---|
| [2968] | 49 | virtual r_8  ThetaOfSlice(int_4 index) const=0; | 
|---|
| [2973] | 50 | /*! | 
|---|
|  | 51 | Return true if some theta slices have a symmetric counter-part at (Pi-Theta) | 
|---|
|  | 52 | (the default implementation return true) | 
|---|
|  | 53 | */ | 
|---|
|  | 54 | virtual bool  HasSymThetaSlice() const { return false; } | 
|---|
|  | 55 | /*! | 
|---|
|  | 56 | Return the slice index for the symmetric slice theta=Pi-ThetaOfSlice(idx) | 
|---|
|  | 57 | an invalid index is returned if the symmetric slice does not exist | 
|---|
|  | 58 | */ | 
|---|
|  | 59 | virtual int_4 GetSymThetaSliceIndex(int_4 idx) const { return -1; } | 
|---|
| [764] | 60 | virtual void GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const=0; | 
|---|
|  | 61 | virtual void GetThetaSlice(int_4 sliceIndex, r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const=0 ; | 
|---|
| [2990] | 62 | /*! | 
|---|
|  | 63 | If possible return a pointer to the slice pixel data. return NULL otherwise | 
|---|
|  | 64 | */ | 
|---|
|  | 65 | virtual T*   GetThetaSliceDataPtr(int_4 sliceIndex) { return NULL; } | 
|---|
| [764] | 66 | }; | 
|---|
| [908] | 67 |  | 
|---|
|  | 68 |  | 
|---|
|  | 69 | } // Fin du namespace | 
|---|
|  | 70 |  | 
|---|
|  | 71 |  | 
|---|
|  | 72 |  | 
|---|
|  | 73 |  | 
|---|
| [764] | 74 | #endif | 
|---|
|  | 75 |  | 
|---|
|  | 76 |  | 
|---|
|  | 77 |  | 
|---|
|  | 78 |  | 
|---|
|  | 79 |  | 
|---|
|  | 80 |  | 
|---|