Ignore:
Timestamp:
Apr 10, 2000, 3:01:22 PM (25 years ago)
Author:
ansari
Message:

Passage SphereHealpix a SphereHEALPix , FITS_SphereHEALPix mis ds FitsIOServer

  1. Ansari 10/4/2000
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyMap/spherehealpix.cc

    r843 r853  
    126126//*******************************************************************
    127127//++
    128 // Class        SphereHealpix
     128// Class        SphereHEALPix
    129129//
    130130// include      SphereHealpix.h strutil.h
     
    177177
    178178template<class T>
    179 SphereHealpix<T>::SphereHealpix()
     179SphereHEALPix<T>::SphereHEALPix()
    180180
    181181//--
     
    187187//++
    188188template<class T>
    189 SphereHealpix<T>::SphereHealpix(int_4 m)
     189SphereHEALPix<T>::SphereHEALPix(int_4 m)
    190190
    191191//    m is the "nside" of the Gorski algorithm
     
    199199  if(m <= 0 || m > 8192)
    200200    {
    201       cout << "SphereHealpix : m hors bornes [0,8192], m= " << m << endl;
    202       throw RangeCheckError("SphereHealpix<T>::SphereHealpix() - Out of bound nside (< 8192)!");
     201      cout << "SphereHEALPix : m hors bornes [0,8192], m= " << m << endl;
     202      throw RangeCheckError("SphereHEALPix<T>::SphereHEALPix() - Out of bound nside (< 8192)!");
    203203    }
    204204  // verifier que m est une puissance de deux
     
    207207  if(x != 1)
    208208    { 
    209       cout<<"SphereHealpix: m doit etre une puissance de deux, m= "<<m<<endl;
    210       throw ParmError("SphereHealpix<T>::SphereHealpix() - nside != 2^n !");
     209      cout<<"SphereHEALPix: m doit etre une puissance de deux, m= "<<m<<endl;
     210      throw ParmError("SphereHEALPix<T>::SphereHEALPix() - nside != 2^n !");
    211211    }
    212212  InitNul();
     
    216216//++
    217217template<class T>
    218 SphereHealpix<T>::SphereHealpix(const SphereHealpix<T>& s, bool share)
     218SphereHEALPix<T>::SphereHEALPix(const SphereHEALPix<T>& s, bool share)
    219219  : pixels_(s.pixels_, share), sliceBeginIndex_(s.sliceBeginIndex_, share),
    220220                                sliceLenght_(s.sliceLenght_, share)
     
    234234//++
    235235template<class T>
    236 SphereHealpix<T>::~SphereHealpix()
     236SphereHEALPix<T>::~SphereHEALPix()
    237237
    238238//--
     
    246246//++
    247247template<class T>
    248 void SphereHealpix<T>::Resize(int_4 m)
     248void SphereHEALPix<T>::Resize(int_4 m)
    249249
    250250//    m is the "nside" of the Gorski algorithm
     
    256256{
    257257  if (m<=0 || m> 8192) {
    258     cout << "SphereHealpix : m hors bornes [0,8192], m= " << m << endl;
     258    cout << "SphereHEALPix : m hors bornes [0,8192], m= " << m << endl;
    259259    exit(1);
    260260  }
     
    264264  if(x != 1)
    265265    { 
    266       cout<<"SphereHealpix: m doit etre une puissance de deux, m= "<<m<<endl;
     266      cout<<"SphereHEALPix: m doit etre une puissance de deux, m= "<<m<<endl;
    267267      exit(1);
    268268    }
     
    273273
    274274template<class T>
    275 void  SphereHealpix<T>::Pixelize( int_4 m)
     275void  SphereHEALPix<T>::Pixelize( int_4 m)
    276276
    277277//    prépare la pixelisation Gorski (m a la même signification
     
    301301
    302302template<class T>
    303 void SphereHealpix<T>::InitNul()
     303void SphereHEALPix<T>::InitNul()
    304304//
    305305//    initialise à zéro les variables de classe
     
    314314//++
    315315template<class T>
    316 int_4 SphereHealpix<T>::NbPixels() const
     316int_4 SphereHEALPix<T>::NbPixels() const
    317317
    318318//    Retourne le nombre de pixels du découpage
     
    324324//++
    325325template<class T>
    326 uint_4 SphereHealpix<T>::NbThetaSlices() const
     326uint_4 SphereHEALPix<T>::NbThetaSlices() const
    327327
    328328//    Return number of slices in theta direction on the  sphere
     
    340340//++
    341341template<class T>
    342 void SphereHealpix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const
     342void SphereHEALPix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const
    343343
    344344//    For a theta-slice with index 'index', return :
     
    355355  if (index<0 || index >= NbThetaSlices())
    356356    {
    357       // THROW(out_of_range("SphereHealpix::PIxVal Pixel index out of range"));
    358       cout << " SphereHealpix::GetThetaSlice : Pixel index out of range" <<endl;
    359       throw RangeCheckError(" SphereHealpix::GetThetaSlice : Pixel index out of range");
     357      // THROW(out_of_range("SphereHEALPix::PIxVal Pixel index out of range"));
     358      cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl;
     359      throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range");
    360360    }
    361361
     
    381381
    382382template<class T>
    383 void SphereHealpix<T>::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const
     383void SphereHEALPix<T>::GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const
    384384
    385385//    For a theta-slice with index 'sliceIndex', return :
     
    398398  if (sliceIndex<0 || sliceIndex >= NbThetaSlices())
    399399    {
    400       // THROW(out_of_range("SphereHealpix::PIxVal Pixel index out of range"));
    401       cout << " SphereHealpix::GetThetaSlice : Pixel index out of range" <<endl;
    402       throw RangeCheckError(" SphereHealpix::GetThetaSlice : Pixel index out of range");
     400      // THROW(out_of_range("SphereHEALPix::PIxVal Pixel index out of range"));
     401      cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl;
     402      throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range");
    403403    }
    404404  int_4 iring= sliceBeginIndex_(sliceIndex);
     
    416416//++
    417417template<class T>
    418 void SphereHealpix<T>::SetThetaSlices() 
     418void SphereHEALPix<T>::SetThetaSlices() 
    419419
    420420//--
     
    443443//++
    444444template<class T>
    445 T& SphereHealpix<T>::PixVal(int_4 k)
     445T& SphereHEALPix<T>::PixVal(int_4 k)
    446446
    447447//    Return value of  pixel with "RING" index k
     
    450450  if((k < 0) || (k >= nPix_))
    451451    {
    452       throw RangeCheckError("SphereHealpix::PIxVal Pixel index out of range");
     452      throw RangeCheckError("SphereHEALPix::PIxVal Pixel index out of range");
    453453    }
    454454  return pixels_(k);
     
    458458//++
    459459template<class T>
    460 T const& SphereHealpix<T>::PixVal(int_4 k) const
     460T const& SphereHEALPix<T>::PixVal(int_4 k) const
    461461
    462462//    Return value of  pixel with "RING" index k
     
    465465  if((k < 0) || (k >= nPix_))
    466466    {
    467       throw RangeCheckError("SphereHealpix::PIxVal Pixel index out of range");
     467      throw RangeCheckError("SphereHEALPix::PIxVal Pixel index out of range");
    468468    }
    469469  return *(pixels_.Data()+k);
     
    472472//++
    473473template<class T>
    474 T& SphereHealpix<T>::PixValNest(int_4 k)
     474T& SphereHEALPix<T>::PixValNest(int_4 k)
    475475
    476476//    Return value of  pixel with "NESTED" index k
     
    479479  if((k < 0) || (k >= nPix_))
    480480    {
    481       throw RangeCheckError("SphereHealpix::PIxValNest Pixel index out of range");
     481      throw RangeCheckError("SphereHEALPix::PIxValNest Pixel index out of range");
    482482    }
    483483  return pixels_(nest2ring(nSide_,k));
     
    486486
    487487template<class T>
    488 T const& SphereHealpix<T>::PixValNest(int_4 k) const
     488T const& SphereHEALPix<T>::PixValNest(int_4 k) const
    489489
    490490//    Return value of  pixel with "NESTED" index k
     
    493493  if((k < 0) || (k >= nPix_))
    494494    {
    495       throw RangeCheckError("SphereHealpix::PIxValNest Pixel index out of range");
     495      throw RangeCheckError("SphereHEALPix::PIxValNest Pixel index out of range");
    496496  }
    497497  int_4 pix= nest2ring(nSide_,k);
     
    502502//++
    503503template<class T>
    504 bool SphereHealpix<T>::ContainsSph(double /*theta*/, double /*phi*/) const
     504bool SphereHEALPix<T>::ContainsSph(double /*theta*/, double /*phi*/) const
    505505//--
    506506{
     
    511511//++
    512512template<class T>
    513 int_4 SphereHealpix<T>::PixIndexSph(double theta,double phi) const
     513int_4 SphereHEALPix<T>::PixIndexSph(double theta,double phi) const
    514514
    515515//    Return "RING" index of the pixel corresponding to
     
    522522//++
    523523template<class T>
    524 int_4 SphereHealpix<T>::PixIndexSphNest(double theta,double  phi) const
     524int_4 SphereHEALPix<T>::PixIndexSphNest(double theta,double  phi) const
    525525
    526526//    Return "NESTED" index of the pixel corresponding to
     
    535535//++
    536536template<class T>
    537 void SphereHealpix<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
     537void SphereHEALPix<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
    538538
    539539//   Return (theta,phi) coordinates of middle of  pixel with "RING" index k
     
    544544
    545545template <class T>
    546 T SphereHealpix<T>::SetPixels(T v)
     546T SphereHEALPix<T>::SetPixels(T v)
    547547{
    548548pixels_.Reset(v);
     
    552552//++
    553553template<class T>
    554 double SphereHealpix<T>::PixSolAngle(int_4 /*dummy*/) const
     554double SphereHEALPix<T>::PixSolAngle(int_4 /*dummy*/) const
    555555//    Pixel Solid angle  (steradians)
    556556//    All the pixels have the same solid angle. The dummy argument is
     
    564564//++
    565565template<class T>
    566 void SphereHealpix<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
     566void SphereHEALPix<T>::PixThetaPhiNest(int_4 k,double& theta,double& phi) const
    567567
    568568//   Return (theta,phi) coordinates of middle of  pixel with "NESTED" index k
     
    574574//++
    575575template<class T>
    576 int_4 SphereHealpix<T>::NestToRing(int_4 k) const
     576int_4 SphereHEALPix<T>::NestToRing(int_4 k) const
    577577
    578578//    translation from NESTED index  into RING index
     
    585585//++
    586586template<class T>
    587 int_4 SphereHealpix<T>::RingToNest(int_4 k) const
     587int_4 SphereHEALPix<T>::RingToNest(int_4 k) const
    588588//
    589589//    translation from  RING index  into NESTED index
     
    596596
    597597template<class T>
    598 int_4 SphereHealpix<T>::nest2ring(int_4 nside, int_4 ipnest) const
     598int_4 SphereHEALPix<T>::nest2ring(int_4 nside, int_4 ipnest) const
    599599{
    600600  /*
     
    678678
    679679template<class T>
    680 int_4 SphereHealpix<T>::ring2nest(int_4 nside, int_4 ipring) const
     680int_4 SphereHEALPix<T>::ring2nest(int_4 nside, int_4 ipring) const
    681681{
    682682  /*
     
    787787
    788788template<class T>
    789 int_4 SphereHealpix<T>::ang2pix_ring(int_4 nside, double theta, double phi) const
     789int_4 SphereHEALPix<T>::ang2pix_ring(int_4 nside, double theta, double phi) const
    790790{
    791791  /*
     
    863863
    864864template<class T>
    865 int_4 SphereHealpix<T>::ang2pix_nest(int_4 nside, double theta, double phi) const
     865int_4 SphereHEALPix<T>::ang2pix_nest(int_4 nside, double theta, double phi) const
    866866{
    867867  /*
     
    960960
    961961template<class T>
    962 void SphereHealpix<T>::pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) const {
     962void SphereHEALPix<T>::pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) const {
    963963  /*
    964964    ===================================================
     
    10281028
    10291029template<class T>
    1030 void SphereHealpix<T>::pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) const {
     1030void SphereHEALPix<T>::pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) const {
    10311031  /*
    10321032    ==================================================
     
    11191119
    11201120template <class T>
    1121 void SphereHealpix<T>::print(ostream& os) const
     1121void SphereHEALPix<T>::print(ostream& os) const
    11221122{
    11231123  if(mInfo_) os << "  DVList Info= " << *mInfo_ << endl;
     
    11521152
    11531153#ifdef __CXX_PRAGMA_TEMPLATES__
    1154 #pragma define_template SphereHealpix<uint_2>
    1155 #pragma define_template SphereHealpix<r_8>
    1156 #pragma define_template SphereHealpix<r_4>
    1157 #pragma define_template SphereHealpix< complex<r_4> >
    1158 #pragma define_template SphereHealpix< complex<r_8> >
     1154#pragma define_template SphereHEALPix<uint_2>
     1155#pragma define_template SphereHEALPix<r_8>
     1156#pragma define_template SphereHEALPix<r_4>
     1157#pragma define_template SphereHEALPix< complex<r_4> >
     1158#pragma define_template SphereHEALPix< complex<r_8> >
    11591159#endif
    11601160#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
    1161 template class SphereHealpix<uint_2>;
    1162 template class SphereHealpix<r_8>;
    1163 template class SphereHealpix<r_4>;
    1164 template class SphereHealpix< complex<r_4> >;
    1165 template class SphereHealpix< complex<r_8> >;
     1161template class SphereHEALPix<uint_2>;
     1162template class SphereHEALPix<r_8>;
     1163template class SphereHEALPix<r_4>;
     1164template class SphereHEALPix< complex<r_4> >;
     1165template class SphereHEALPix< complex<r_8> >;
    11661166#endif
    11671167
Note: See TracChangeset for help on using the changeset viewer.