Changeset 2990 in Sophya for trunk/SophyaLib/SkyMap
- Timestamp:
- Jun 23, 2006, 12:35:17 PM (19 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/sphereecp.cc
r2987 r2990 167 167 string SphereECP<T>::TypeOfMap() const 168 168 { 169 return string(" TETAFI");169 return string("ECP"); 170 170 } 171 171 … … 370 370 return; 371 371 372 } 373 374 template <class T> 375 T* SphereECP<T>::GetThetaSliceDataPtr(int_4 index) 376 { 377 if( (index < 0) || (index >= _pixels.SizeY()) ) 378 throw RangeCheckError("SphereECP::GetThetaSliceDataPtr() index out of range"); 379 int_4 ioff = _phi1/_dphi; 380 if (ioff != 0) return NULL; 381 return _pixels.Data() + index*_pixels.SizeX(); 372 382 } 373 383 -
trunk/SophyaLib/SkyMap/sphereecp.h
r2985 r2990 109 109 virtual void GetThetaSlice(int_4 sliceIndex, r_8& theta, r_8& phi0, 110 110 TVector<int_4>& pixelIndices,TVector<T>& value) const ; 111 virtual T* GetThetaSliceDataPtr(int_4 index); 111 112 112 113 // Valeur de pixel hors carte -
trunk/SophyaLib/SkyMap/spherehealpix.cc
r2987 r2990 340 340 void SphereHEALPix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const 341 341 { 342 if (index<0 || index >= NbThetaSlices()) { 343 cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl; 344 throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range"); 345 } 342 if (index<0 || index >= NbThetaSlices()) 343 throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range"); 346 344 347 345 int_4 iring= sliceBeginIndex_(index); … … 388 386 389 387 template<class T> 390 void SphereHEALPix<T>::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const 388 void SphereHEALPix<T>::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, 389 TVector<int_4>& pixelIndices,TVector<T>& value) const 391 390 392 391 { 393 392 394 393 if (sliceIndex<0 || sliceIndex >= NbThetaSlices()) 395 { 396 cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl; 397 throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range"); 398 } 394 throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range"); 399 395 int_4 iring= sliceBeginIndex_(sliceIndex); 400 396 int_4 lring = sliceLenght_(sliceIndex); … … 417 413 PixThetaPhi(ring2nest(nSide_,iring), theta, phi0); 418 414 } 415 } 416 417 //! return a pointer to the specified slice pixel data in RING ordering, NULL in NESTED 418 template<class T> 419 T* SphereHEALPix<T>::GetThetaSliceDataPtr(int_4 sliceIndex) 420 421 { 422 if (sliceIndex<0 || sliceIndex >= NbThetaSlices()) 423 throw RangeCheckError(" SphereHEALPix::GetThetaSliceDataPtr(): index out of range"); 424 if (fgring_) 425 return pixels_.Begin()+sliceBeginIndex_(sliceIndex); 426 else return NULL; 419 427 } 420 428 -
trunk/SophyaLib/SkyMap/spherehealpix.h
r2985 r2990 91 91 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const; 92 92 virtual void GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const ; 93 virtual T* GetThetaSliceDataPtr(int_4 sliceIndex); 93 94 94 95 virtual bool ContainsSph(double theta, double phi) const; -
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r2987 r2990 192 192 NPix_ = a.NPix_; 193 193 Omega_ = a.Omega_; 194 int k;194 int_4 k; 195 195 for (k=0; k< NPix_; k++) pixels_(k) = a.pixels_(k); 196 196 for (k=0; k< a.NPhi_.Size(); k++) NPhi_(k) = a.NPhi_(k); … … 246 246 { 247 247 double dphi; 248 int i,k;248 int_4 i,k; 249 249 bool fgzn = false; 250 250 … … 270 270 void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const 271 271 { 272 int i;272 int_4 i; 273 273 bool fgzn = false; 274 274 … … 316 316 void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 317 317 { 318 int j;318 int_4 j; 319 319 double dphi; 320 320 bool fgzn= false; … … 335 335 336 336 // on recupere l'indice i de la tranche qui contient le pixel k 337 int i;337 int_4 i; 338 338 for( i=0; i< NTheta_; i++ ) 339 339 if(k < TNphi_(i+1)) break; … … 378 378 int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const 379 379 { 380 int nbpix;380 int_4 nbpix; 381 381 // verification 382 382 if((kt < 0) || (kt >= 2*NTheta_)) return(-1); … … 455 455 int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const 456 456 { 457 int k;457 int_4 k; 458 458 bool fgzn= false; 459 459 … … 494 494 495 495 // on recupere l'indice kt de la tranche qui contient le pixel k 496 int i;496 int_4 i; 497 497 for(i = 0; i < NTheta_; i++) 498 498 if(k < TNphi_(i+1)) break; … … 523 523 //-- 524 524 { 525 int ntotpix,j;525 int_4 ntotpix,j; 526 526 527 527 // Decodage et controle des arguments d'appel : … … 634 634 635 635 636 int iring= Index(index,0);637 int lring = NPhi(index);636 int_4 iring= Index(index,0); 637 int_4 lring = NPhi(index); 638 638 639 639 phi.ReSize(lring); … … 643 643 PixThetaPhi(iring,Te,Fi); 644 644 double DFi = DeuxPi/(double)NPhi(index); 645 for(int kk = 0; kk < lring; kk++) {645 for(int_4 kk = 0; kk < lring; kk++) { 646 646 value(kk)= pixels_(kk+iring); 647 647 phi(kk)= Fi; … … 668 668 throw RangeCheckError("SphereThetaPhi::GetThetaSlice(idx...) idx out of range"); 669 669 670 int iring= Index(index,0);671 int lring = NPhi(index);670 int_4 iring= Index(index,0); 671 int_4 lring = NPhi(index); 672 672 673 673 pixelIndices.ReSize(lring); … … 675 675 double Te= 0.; 676 676 double Fi= 0.; 677 for(int kk = 0; kk < lring; kk++) {677 for(int_4 kk = 0; kk < lring; kk++) { 678 678 pixelIndices(kk)=kk+iring ; 679 679 value(kk)= pixels_(kk+iring); … … 682 682 } 683 683 684 684 //! return a pointer to the specified slice pixel data 685 template <class T> 686 T* SphereThetaPhi<T>::GetThetaSliceDataPtr(int_4 index) 687 { 688 if(index < 0 || index >= NbThetaSlices()) 689 throw RangeCheckError("SphereThetaPhi::GetThetaSliceDataPtr(idx) idx out of range"); 690 return pixels_.Begin()+Index(index,0); 691 } 685 692 686 693 … … 694 701 695 702 os << "... NPhi_ Values : "; 696 int i;703 int_4 i; 697 704 for(i=0; i < NTheta_; i++) 698 705 { -
trunk/SophyaLib/SkyMap/spherethetaphi.h
r2985 r2990 132 132 virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const; 133 133 virtual void GetThetaSlice(int_4 index, r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const ; 134 virtual T* GetThetaSliceDataPtr(int_4 sliceIndex); 134 135 135 136 -
trunk/SophyaLib/SkyMap/sphericalmap.h
r2973 r2990 60 60 virtual void GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const=0; 61 61 virtual void GetThetaSlice(int_4 sliceIndex, r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const=0 ; 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; } 62 66 }; 63 67
Note:
See TracChangeset
for help on using the changeset viewer.