Changeset 2960 in Sophya for trunk/SophyaLib/SkyMap/spherethetaphi.h
- Timestamp:
- Jun 1, 2006, 4:35:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherethetaphi.h
r2433 r2960 21 21 22 22 // ***************** Class SphereThetaPhi ***************************** 23 /*! sphere splitted with respect to theta, phi : each hemisphere is24 splitted into (m-1) parallels (equator does not enter into account).25 This operation defines m slices, each of which is splitted into26 equidistant meridians. This splitting is realized in such a way that27 all pixels have the same area and are as square as possible.28 29 One begins with the hemisphere with positive z, starting from the pole30 toward the equator. The first pixel is the polar cap ; it is circular31 and centered on theta=0.32 */33 23 template <class T> 34 24 class SphereThetaPhi : public SphericalMap<T> … … 38 28 39 29 SphereThetaPhi(); 40 /*! m is the number of slices in theta on an hemisphere (the polar cap41 forms the first slice).42 pet is a dummy parameter at the moment.43 */44 30 SphereThetaPhi(int_4 m); 45 31 SphereThetaPhi(const SphereThetaPhi<T>& s, bool share); … … 68 54 69 55 /* retourne le nombre de pixels */ 70 /*! Return total number of pixels */71 56 virtual int_4 NbPixels() const; 72 57 73 58 /* retourne la valeur du pixel d'indice k */ 74 /*! Return value of pixel with index k */75 59 virtual T& PixVal(int_4 k); 76 60 virtual T const& PixVal(int_4 k) const; … … 83 67 84 68 /* retourne les coordonnees Spheriques du centre du pixel d'indice k */ 85 /*! Return (theta,phi) coordinates of middle of pixel with index k */86 69 virtual void PixThetaPhi(int_4 k, double& theta, double& phi) const; 87 70 88 /* !Setting pixel values to a constant */71 /* Setting pixel values to a constant */ 89 72 virtual T SetPixels(T v); 90 73 91 74 /* retourne/fixe l'angle Solide de Pixel (steradians) */ 92 /*! Pixel Solid angle (steradians)93 94 All the pixels have the same solid angle. The dummy argument is95 for compatibility with eventual pixelizations which would not96 fulfil this requirement.97 */98 75 virtual double PixSolAngle(int_4 dummy=0) const; 99 76 100 77 /* retourne/fixe la valeur du parametre de decoupage m */ 78 //! Return the pixelisation parameter (number of slices in a hemisphere) 101 79 inline virtual int_4 SizeIndex() const { return( NTheta_); } 102 80 103 81 /* Acces to the DataBlock */ 82 //! Acces to the pixel data NDataBlock<T> object 104 83 inline NDataBlock<T>& DataBlock() {return pixels_;} 84 //! Acces to the pixel data NDataBlock<T> object (const version) 105 85 inline const NDataBlock<T>& DataBlock() const {return pixels_;} 106 86 107 87 // ------------- Specific methods ---------------------- 108 88 109 /*! re-pixelize the sphere */110 89 virtual void Resize(int_4 m); 111 90 … … 117 96 118 97 /* Nombre de tranches en theta */ 119 /* !Return number of theta-slices on the sphere */98 /* Return number of theta-slices on the sphere */ 120 99 uint_4 NbThetaSlices() const; 121 100 … … 125 104 /* Renvoie dans t1,t2 les valeurs respectives de theta min et theta max */ 126 105 /* de la tranche d'indice kt */ 127 /*! Return theta values which limit the slice kt */128 106 void Theta(int_4 kt, double& t1, double& t2); 129 107 130 108 /* Renvoie dans p1,p2 les valeurs phimin et phimax du pixel d'indice jp */ 131 109 /* dans la tranche d'indice kt */ 132 /*! Return values of phi which limit the jp-th pixel of the kt-th slice */133 110 void Phi(int_4 kt, int_4 jp, double& p1, double& p2); 134 111 … … 138 115 139 116 /* Indice kt de la tranche et indice jp du pixel d'indice k */ 140 /*! Return indices kt (theta) and jp (phi) of pixel with index k */141 117 void ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp); 142 118 143 /*! achieve the splitting into pixels (m has the same signification144 as for the constructor)145 146 Each theta-slice of the north hemisphere will be spitted starting f147 from phi=0 ...148 149 South hemisphere is scanned in the same direction according to phi150 and from equator to the pole (the pixel following the last one of151 the slice closest to the equator with z>0, is the pixel with lowest152 phi of the slice closest of the equator with z<0).153 */154 119 void Pixelize(int_4); 155 120 156 /*! For a theta-slice with index 'index', return :157 158 the corresponding "theta"159 160 a vector containing the phi's of the pixels of the slice161 162 a vector containing the corresponding values of pixels163 */164 121 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const; 165 166 /*! For a theta-slice with index 'index', return :167 168 the corresponding "theta"169 170 the corresponding "phi" for first pixel of the slice171 172 a vector containing indices of the pixels of the slice173 174 (equally distributed in phi)175 176 a vector containing the corresponding values of pixels177 */178 122 virtual void GetThetaSlice(int_4 index, r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const ; 179 123 180 124 181 / * impression */125 //! ASCII dump (print) of the pixel map 182 126 void print(ostream& os) const; 183 127 … … 331 275 inline SphereThetaPhi<T> operator - (const SphereThetaPhi<T>& a,const SphereThetaPhi<T>& b) 332 276 { SphereThetaPhi<T> result; result.SetTemp(true); 333 if (b.IsTemp()) { result.Share(b); result.SubElt(a, true); } 334 else { result.CloneOrShare(a); result.SubElt(b); } 277 result.CloneOrShare(a); result.SubElt(b); 335 278 return result; } 336 279
Note:
See TracChangeset
for help on using the changeset viewer.