Changeset 3506 in Sophya
- Timestamp:
- Aug 8, 2008, 12:52:17 PM (17 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/sphereecp.cc
r2995 r3506 9 9 10 10 Class implementing spherical maps, with a pixelisation 11 corresponding to the an Equatorial Cylindrical Projection .11 corresponding to the an Equatorial Cylindrical Projection (ECP). 12 12 Pixel size varie from equator to poles. The sphere is divided 13 13 into a number of slices along the parallels. Each slice is subdivided … … 164 164 } 165 165 166 /*! 167 \brief Extract a partial map from a full ECP skymap 168 Theta and Phi limits are adjusted automatically to be correspond to the source map pixel boundaries 169 */ 170 template <class T> 171 SphereECP<T> SphereECP<T>::ExtractPartial(r_8 tet1, r_8 tet2, r_8 phi1, r_8 phi2) 172 { 173 if (IsPartial()) 174 throw ParmError("SphereECP::ExtractPartial() source map NOT a full sky map"); 175 if( (tet1 > M_PI) || (tet1 < 0.) || (tet2 > M_PI) || (tet2 < 0.) || 176 (phi1 < 0.) || (phi1 > 2*M_PI) || (phi1 < 0.) || (phi1 > 2*M_PI) || 177 (tet2 <= tet1) || (phi2 <= phi1) ) 178 throw ParmError("SphereECP::ExtractPartial() Bad range for theta/phi limits"); 179 180 // correction/calcul des limites en theta et nombre de rangees en theta 181 sa_size_t ntet = (sa_size_t)((tet2-tet1)/_dtheta + 0.5); 182 sa_size_t offt = (sa_size_t)(tet1/_dtheta + 1e-3); 183 tet1 = _dtheta*offt; 184 tet2 = tet1+ntet*_dtheta; 185 // correction/calcul des limites en phi et nombre de colonnes en phi 186 sa_size_t nphi = (sa_size_t)((phi2-phi1)/_dphi + 0.5); 187 sa_size_t offp = (sa_size_t)(phi1/_dphi + 1e-3); 188 phi1 = _dphi*offp; 189 phi2 = phi1+nphi*_dphi; 190 191 // On cree une carte partielle avec les bons parametres 192 SphereECP<T> pmap(tet1, tet2, ntet, phi1, phi2, nphi); 193 // On recopie les valeurs de pixels de la zone correspondante 194 pmap.GetPixelArray() = _pixels.SubArray(Range(offp, 0, nphi, 0), Range(offt, 0, ntet, 0), 195 Range::first(), Range::first(), Range::first()); 196 return pmap; 197 } 198 166 199 template <class T> 167 200 string SphereECP<T>::TypeOfMap() const … … 242 275 int_4 jp = k % _pixels.SizeX(); 243 276 theta = _theta1+(it+0.5)*_dtheta; 244 phi = _phi1 *(jp+0.5)*_dphi;277 phi = _phi1+(jp+0.5)*_dphi; 245 278 return; 246 279 } -
trunk/SophyaLib/SkyMap/sphereecp.h
r3174 r3506 9 9 /* Classe de carte spherique avec decoupage theta-phi 10 10 (projection cylindique: Equatorial Cylindrical Projection) 11 avec couverture posiibilite de couverture partielle, 12 limites en theta,phi 11 avec possibilite de couverture partielle, limitees en theta,phi 13 12 R. Ansari - Septembre 2004 14 13 */ … … 44 43 virtual ~SphereECP(); 45 44 46 // Renvoie TETAPHI comme les SphereThetaPhi pour le moment 45 // Extraction de carte partielle d'une carte ECP complete 46 virtual SphereECP<T> ExtractPartial(r_8 tet1, r_8 tet2, r_8 phi1, r_8 phi2); 47 48 49 // Renvoie Type ECP 47 50 virtual string TypeOfMap() const; 48 51 virtual void SetTemp(bool temp=false) const; // A supprimer
Note:
See TracChangeset
for help on using the changeset viewer.