Changeset 682 in Sophya for trunk/SophyaLib/Samba/spherethetaphi.cc
- Timestamp:
- Dec 10, 1999, 5:56:03 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/spherethetaphi.cc
r604 r682 50 50 //++ 51 51 template <class T> 52 SphereThetaPhi<T>::SphereThetaPhi(int m)52 SphereThetaPhi<T>::SphereThetaPhi(int_4 m) 53 53 54 54 // m is the number of slices in theta on an hemisphere (the polar cap … … 68 68 NTheta_= s.NTheta_; 69 69 NPix_ = s.NPix_; 70 NPhi_ = new int [NTheta_];70 NPhi_ = new int_4[NTheta_]; 71 71 Theta_ = new double[NTheta_+1]; 72 TNphi_ = new int [NTheta_+1];72 TNphi_ = new int_4[NTheta_+1]; 73 73 for(int k = 0; k < NTheta_; k++) 74 74 { … … 123 123 //++ 124 124 template <class T> 125 void SphereThetaPhi<T>::Resize(int m)125 void SphereThetaPhi<T>::Resize(int_4 m) 126 126 // re-pixelize the sphere 127 127 //-- … … 134 134 //++ 135 135 template <class T> 136 int SphereThetaPhi<T>::NbPixels() const136 int_4 SphereThetaPhi<T>::NbPixels() const 137 137 138 138 // Return total number of pixels … … 145 145 //++ 146 146 template <class T> 147 T& SphereThetaPhi<T>::PixVal(int k)147 T& SphereThetaPhi<T>::PixVal(int_4 k) 148 148 149 149 // Return value of pixel with index k … … 161 161 //++ 162 162 template <class T> 163 T const& SphereThetaPhi<T>::PixVal(int k) const163 T const& SphereThetaPhi<T>::PixVal(int_4 k) const 164 164 165 165 // Return value of pixel with index k … … 178 178 //++ 179 179 template <class T> 180 bool SphereThetaPhi<T>::ContainsSph(double theta, double phi) const180 bool SphereThetaPhi<T>::ContainsSph(double /*theta*/, double /*phi*/) const 181 181 //-- 182 182 { … … 187 187 //++ 188 188 template <class T> 189 int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const189 int_4 SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const 190 190 191 191 // Return index of the pixel corresponding to … … 208 208 dphi= DeuxPi/(double)NPhi_[i-1]; 209 209 210 if (fgzn) k= NPix_-TNphi_[i]+(int )(phi/dphi);211 else k= TNphi_[i-1]+(int )(phi/dphi);210 if (fgzn) k= NPix_-TNphi_[i]+(int_4)(phi/dphi); 211 else k= TNphi_[i-1]+(int_4)(phi/dphi); 212 212 return(k); 213 213 } … … 216 216 //++ 217 217 template <class T> 218 void SphereThetaPhi<T>::PixThetaPhi(int k,double& theta,double& phi) const218 void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const 219 219 220 220 // Return (theta,phi) coordinates of middle of pixel with index k … … 250 250 //++ 251 251 template <class T> 252 double SphereThetaPhi<T>::PixSolAngle(int dummy) const252 double SphereThetaPhi<T>::PixSolAngle(int_4 /*dummy*/) const 253 253 254 254 // Pixel Solid angle (steradians) … … 264 264 //++ 265 265 template <class T> 266 void SphereThetaPhi<T>::Limits(int k,double& tetMin,double& tetMax,double& phiMin,double& phiMax)266 void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax) 267 267 268 268 // Return values of theta,phi which limit the pixel with index k … … 317 317 //++ 318 318 template <class T> 319 int SphereThetaPhi<T>::NbThetaSlices() const319 int_4 SphereThetaPhi<T>::NbThetaSlices() const 320 320 321 321 // Return number of theta-slices on the sphere … … 330 330 //++ 331 331 template <class T> 332 int SphereThetaPhi<T>::NPhi(intkt) const332 int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const 333 333 334 334 // Return number of pixels in phi-direction of the kt-th slice … … 353 353 //++ 354 354 template <class T> 355 void SphereThetaPhi<T>::Theta(int kt,double& tetMin,double& tetMax)355 void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax) 356 356 357 357 // Return theta values which limit the slice kt … … 385 385 //++ 386 386 template <class T> 387 void SphereThetaPhi<T>::Phi(int kt,intjp,double& phiMin,double& phiMax)387 void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax) 388 388 389 389 // Return values of phi which limit the jp-th pixel of the kt-th slice … … 416 416 //++ 417 417 template <class T> 418 int SphereThetaPhi<T>::Index(int kt,intjp) const418 int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const 419 419 420 420 // Return pixel index with sequence index jp in the slice kt … … 449 449 //++ 450 450 template <class T> 451 void SphereThetaPhi<T>::ThetaPhiIndex(int k,int& kt,int& jp)451 void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp) 452 452 453 453 // Return indices kt (theta) and jp (phi) of pixel with index k … … 477 477 //++ 478 478 template <class T> 479 void SphereThetaPhi<T>::Pixelize(int m)479 void SphereThetaPhi<T>::Pixelize(int_4 m) 480 480 481 481 // achieve the splitting into pixels (m has the same signification … … 507 507 508 508 // Le nombre de pixels en phi de chacune des bandes en theta 509 NPhi_ = new int [m];509 NPhi_ = new int_4[m]; 510 510 511 511 // Le nombre/Deuxpi total des pixels contenus dans les bandes de z superieur a une 512 512 // bande donnee (mTPphi[m] contient le nombre de pixels total de l'hemisphere) 513 TNphi_= new int [m+1];513 TNphi_= new int_4[m+1]; 514 514 515 515 // Calcul du nombre total de pixels dans chaque bande pour optimiser … … 524 524 { 525 525 TNphi_[j]= TNphi_[j-1]+NPhi_[j-1]; 526 NPhi_[j] = (int )(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ;526 NPhi_[j] = (int_4)(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ; 527 527 } 528 528 … … 556 556 //++ 557 557 template <class T> 558 void SphereThetaPhi<T>::GetThetaSlice(int index,double& theta, TVector<double>& phi, TVector<T>& value) const558 void SphereThetaPhi<T>::GetThetaSlice(int_4 index,double& theta, TVector<double>& phi, TVector<T>& value) const 559 559 560 560 // For a theta-slice with index 'index', return : … … 593 593 594 594 template <class T> 595 void SphereThetaPhi<T>::setmNPhi(int * array, intm)595 void SphereThetaPhi<T>::setmNPhi(int_4* array, int_4 m) 596 596 //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta 597 597 // 598 598 { 599 NPhi_= new int [m];599 NPhi_= new int_4[m]; 600 600 for(int k = 0; k < m; k++) NPhi_[k]= array[k]; 601 601 } 602 602 603 603 template <class T> 604 void SphereThetaPhi<T>::setmTNphi(int * array, intm)604 void SphereThetaPhi<T>::setmTNphi(int_4* array, int_4 m) 605 605 //remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes 606 606 // 607 607 { 608 TNphi_= new int [m];608 TNphi_= new int_4[m]; 609 609 for(int k = 0; k < m; k++) TNphi_[k]= array[k]; 610 610 } 611 611 612 612 template <class T> 613 void SphereThetaPhi<T>::setmTheta(double* array, int m)613 void SphereThetaPhi<T>::setmTheta(double* array, int_4 m) 614 614 //remplit le tableau contenant les valeurs limites de theta 615 615 // … … 620 620 621 621 template <class T> 622 void SphereThetaPhi<T>::setDataBlock(T* data, int m)622 void SphereThetaPhi<T>::setDataBlock(T* data, int_4 m) 623 623 // remplit le vecteur des contenus des pixels 624 624 { … … 743 743 } 744 744 745 int mNTheta;745 int_4 mNTheta; 746 746 is.GetI4(mNTheta); 747 747 dobj->setSizeIndex(mNTheta); 748 748 749 int mNPix;749 int_4 mNPix; 750 750 is.GetI4(mNPix); 751 751 dobj->setNbPixels(mNPix); … … 755 755 dobj->setPixSolAngle(mOmeg); 756 756 757 int * mNphi= new int[mNTheta];757 int_4* mNphi= new int_4[mNTheta]; 758 758 is.GetI4s(mNphi, mNTheta); 759 759 dobj->setmNPhi(mNphi, mNTheta); 760 760 delete [] mNphi; 761 761 762 int * mTNphi= new int[mNTheta+1];762 int_4* mTNphi= new int_4[mNTheta+1]; 763 763 is.GetI4s(mTNphi, mNTheta+1); 764 764 dobj->setmTNphi(mTNphi, mNTheta+1); … … 788 788 789 789 char strg[256]; 790 int mNTheta= dobj->SizeIndex();791 int mNPix = dobj->NbPixels();790 int_4 mNTheta= dobj->SizeIndex(); 791 int_4 mNPix = dobj->NbPixels(); 792 792 793 793 if(dobj->ptrInfo())
Note:
See TracChangeset
for help on using the changeset viewer.