Changeset 1217 in Sophya for trunk/SophyaLib/SkyMap/spherehealpix.h
- Timestamp:
- Oct 3, 2000, 10:19:18 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherehealpix.h
r1196 r1217 16 16 // ***************** CLASSE SphereHEALPix ***************************** 17 17 18 //! class SphereHEALPix 19 /*! 20 Pixelisation Gorski 21 22 23 ----------------------------------------------------------------------- 24 version 0.8.2 Aug97 TAC Eric Hivon, Kris Gorski 25 ----------------------------------------------------------------------- 26 27 the sphere is split in 12 diamond-faces containing nside**2 pixels each 28 29 the numbering of the pixels (in the nested scheme) is similar to 30 quad-cube 31 In each face the first pixel is in the lowest corner of the diamond 32 33 the faces are (x,y) coordinate on each face 34 \verbatim 35 . . . . <--- North Pole 36 / \ / \ / \ / \ ^ ^ 37 . 0 . 1 . 2 . 3 . <--- z = 2/3 \ / 38 \ / \ / \ / \ / y \ / x 39 4 . 5 . 6 . 7 . 4 <--- equator \ / 40 / \ / \ / \ / \ \/ 41 . 8 . 9 .10 .11 . <--- z = -2/3 (0,0) : lowest corner 42 \ / \ / \ / \ / 43 . . . . <--- South Pole 44 \endverbatim 45 phi:0 2Pi 46 47 in the ring scheme pixels are numbered along the parallels 48 the first parallel is the one closest to the north pole and so on 49 on each parallel, pixels are numbered starting from the one closest 50 to phi = 0 51 52 nside MUST be a power of 2 (<= 8192) 53 54 */ 18 /*! Class SphereHEALPix */ 55 19 56 20 … … 81 45 82 46 SphereHEALPix(); 83 /*!84 m is the "nside" of the Gorski algorithm85 86 The total number of pixels will be Npix = 12*nside**287 88 nside MUST be a power of 2 (<= 8192)89 */90 47 SphereHEALPix(int_4 m); 91 48 SphereHEALPix(const SphereHEALPix<T>& s, bool share); 92 49 SphereHEALPix(const SphereHEALPix<T>& s); 93 //! Destructor94 50 virtual ~SphereHEALPix(); 95 51 96 // Temporaire?97 52 inline virtual bool IsTemp(void) const { 98 53 … … 101 56 return pixels_.IsTemp(); 102 57 } 103 /*! Setting blockdata to temporary (see ndatablock documentation) */ 58 104 59 inline virtual void SetTemp(bool temp=false) const 105 60 { … … 110 65 // ------------------ Definition of PixelMap abstract methods 111 66 112 /* Nombre de pixels du decoupage */113 /*! Return number of pixels of the splitting */114 67 virtual int_4 NbPixels() const; 115 68 116 /* Valeur du contenu du pixel d'indice "RING" k */117 /*! Return value of pixel with "RING" index k */118 69 virtual T& PixVal(int_4 k); 119 70 virtual T const& PixVal(int_4 k) const; 120 71 121 /* Nombre de tranches en theta */122 /*! Return number of slices in theta direction on the sphere */123 72 uint_4 NbThetaSlices() const; 124 /*! For a theta-slice with index 'index', return :125 126 the corresponding "theta"127 128 a vector containing the phi's of the pixels of the slice129 130 a vector containing the corresponding values of pixels131 */132 73 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const; 133 /*! For a theta-slice with index 'index', return :134 135 the corresponding "theta"136 137 the corresponding "phi" for first pixel of the slice138 139 a vector containing indices of the pixels of the slice140 141 (equally distributed in phi)142 143 a vector containing the corresponding values of pixels144 */145 74 virtual void GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const ; 146 75 147 /* Return true if teta,phi in map */148 76 virtual bool ContainsSph(double theta, double phi) const; 149 /* Indice "RING" du pixel vers lequel pointe une direction definie par150 ses coordonnees spheriques */151 /*! Return "RING" index of the pixel corresponding to direction (theta, phi).152 */153 77 virtual int_4 PixIndexSph(double theta,double phi) const; 154 78 155 /* Coordonnees spheriques du milieu du pixel d'indice "RING" k */156 79 virtual void PixThetaPhi(int_4 k,double& theta,double& phi) const; 157 80 158 /*! Set all pixels to value v */159 81 virtual T SetPixels(T v); 160 82 161 /* Pixel Solid angle (steradians) */ 162 /*! Pixel Solid angle (steradians) 83 /*! Pixel Solid angle (steradians) 163 84 164 85 All the pixels have the same solid angle. The dummy argument is … … 166 87 fulfil this requirement. 167 88 */ 168 virtual double PixSolAngle(int_4 dummy=0) const; 89 inline virtual double PixSolAngle(int_4 dummy=0) const {return omeg_;} 169 90 170 91 /* Acces to the DataBlock */ … … 174 95 // --------------- Specific methods 175 96 176 /*!177 m is the "nside" of the Gorski algorithm178 179 The total number of pixels will be Npix = 12*nside**2180 181 nside MUST be a power of 2 (<= 8192)182 */183 97 virtual void Resize(int_4 m); 184 98 185 // pour l'instant le tableau est ordonne selon RING, uniquement 99 /*! 100 101 \return type of storage of the map : RING or NESTED 102 103 at the moment, always RING 104 */ 186 105 inline virtual char* TypeOfMap() const {return "RING";}; 187 106 188 107 189 /* Valeur du contenu du pixel d'indice "NEST" k */190 /*! Return value of pixel with "NESTED" index k */191 108 virtual T& PixValNest(int_4 k); 192 /*! Return value of pixel with "NESTED" index k */193 109 virtual T const& PixValNest(int_4 k) const; 194 110 195 /* Indice "NEST" du pixel vers lequel pointe une direction definie par196 ses coordonnees spheriques */197 /*! Return "NESTED" index of the pixel corresponding to direction (theta, phi).198 */199 111 virtual int_4 PixIndexSphNest(double theta,double phi) const; 200 112 201 /* Coordonnees spheriques du milieu du pixel d'indice "NEST" k */202 /*! Return (theta,phi) coordinates of middle of pixel with "NESTED" index k203 */204 113 virtual void PixThetaPhiNest(int_4 k,double& theta,double& phi) const; 205 114 206 /* algorithme de pixelisation */207 115 void Pixelize(int_4); 208 116 209 /* convertit index nested en ring */210 /*! translation from NESTED index into RING index */211 117 int_4 NestToRing(int_4) const; 212 118 213 /* convertit index ring en nested" */214 /*! translation from RING index into NESTED index */215 119 int_4 RingToNest(int_4) const; 216 120 217 121 218 /* retourne la valeur du parametre Gorski*/122 /*! \return value of healpix nside */ 219 123 inline virtual int_4 SizeIndex() const {return(nSide_);} 220 124 221 /* impression */222 125 void print(ostream& os) const; 223 126 … … 256 159 257 160 NDataBlock<T> pixels_; 258 NDataBlock<int_4> sliceBeginIndex_; // Rationalisation Mac.D.Y.161 NDataBlock<int_4> sliceBeginIndex_; // Rationalisation Mac. D.Y. 259 162 NDataBlock<int_4> sliceLenght_; 260 163
Note:
See TracChangeset
for help on using the changeset viewer.