Changeset 2968 in Sophya


Ignore:
Timestamp:
Jun 6, 2006, 6:53:51 PM (19 years ago)
Author:
ansari
Message:

Ajout methode ThetaOfSlice() a l'interface SphericalMap et propagation , Reza 06/06/2006

Location:
trunk/SophyaLib/SkyMap
Files:
7 edited

Legend:

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

    r2882 r2968  
    304304
    305305template <class T>
     306r_8  SphereECP<T>::ThetaOfSlice(int_4 index) const
     307{
     308  if( (index < 0) || (index >= _pixels.SizeY()) ) 
     309     throw RangeCheckError("SphereECP::ThetaOfSlice() theta index out of range");
     310  return (_theta1 + (index+0.5)*_dtheta);
     311 
     312}
     313
     314template <class T>
    306315void  SphereECP<T>::GetThetaSlice(int_4 index,r_8& theta,
    307316                                  TVector<r_8>& phi, TVector<T>& value) const
    308317{
    309318  if( (index < 0) || (index >= _pixels.SizeY()) ) 
    310      throw RangeCheckError("SphereECP::GetThetaSlice() theta index out of range");
     319     throw RangeCheckError("SphereECP::GetThetaSlice() index out of range");
    311320
    312321  theta = _theta1 + (index+0.5)*_dtheta;
     
    336345{
    337346  if( (index < 0) || (index >= _pixels.SizeY()) ) 
    338     throw RangeCheckError("SphereECP::GetThetaSlice() theta index out of range");
     347    throw RangeCheckError("SphereECP::GetThetaSlice() index out of range");
    339348 
    340349  theta = _theta1 + (index+0.5)*_dtheta;
  • trunk/SophyaLib/SkyMap/sphereecp.h

    r2623 r2968  
    9696  inline  uint_4        NbPhiSlices() const { return _pixels.SizeX(); }
    9797
     98  virtual r_8           ThetaOfSlice(int_4 index) const;
    9899  virtual void          GetThetaSlice(int_4 index,r_8& theta,
    99100                                      TVector<r_8>& phi, TVector<T>& value) const ;
  • trunk/SophyaLib/SkyMap/spherehealpix.cc

    r2960 r2968  
    299299}
    300300
     301//! Return the theta angle for slice defined by \b index
     302template<class T>
     303r_8 SphereHEALPix<T>::ThetaOfSlice(int_4 index) const
     304{
     305  uint_4 nbslices = uint_4(4*nSide_-1);
     306  if (index<0 || index >= nbslices)
     307    throw RangeCheckError(" SphereHEALPix::ThetaOfSlice()  index out of range");
     308  r_8 theta, phi0;
     309  PixThetaPhi(sliceBeginIndex_(index), theta, phi0);
     310  return theta;
     311}
     312
    301313/*!  \fn void SOPHYA::SphereHEALPix::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const
    302314
     
    317329    {
    318330      cout << " SphereHEALPix::GetThetaSlice : Pixel index out of range" <<endl;
    319       throw RangeCheckError(" SphereHEALPix::GetThetaSlice : Pixel index out of range");
     331      throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range");
    320332    }
    321333
  • trunk/SophyaLib/SkyMap/spherehealpix.h

    r2965 r2968  
    7070virtual T const& PixVal(int_4 k) const;
    7171
    72 uint_4 NbThetaSlices() const;
     72virtual uint_4 NbThetaSlices() const;
     73virtual r_8  ThetaOfSlice(int_4 index) const;
    7374virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const;
    7475virtual void GetThetaSlice(int_4 sliceIndex,r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const ;
  • trunk/SophyaLib/SkyMap/spherethetaphi.cc

    r2960 r2968  
    592592}
    593593
     594//! Return the theta angle for slice defined by \b index
     595template <class T>
     596r_8 SphereThetaPhi<T>::ThetaOfSlice(int_4 index) const
     597{
     598  if(index < 0 || index >= 2*NTheta_)
     599    throw RangeCheckError("SphereThetaPhi::ThetaOfSlice() index out of range");
     600  double tet1, tet2;
     601  Theta(index, tet1, tet2);
     602  return 0.5*(tet1+tet2); 
     603}
    594604
    595605/*!   
     
    606616
    607617  if(index < 0 || index >= NbThetaSlices())
    608     {
    609        throw RangeCheckError("SphereThetaPhi::PIxVal Pixel index out of range");
    610     }
     618    throw RangeCheckError("SphereThetaPhi::GetThetaSlice() index out of range");
     619   
    611620
    612621  int iring= Index(index,0);
  • trunk/SophyaLib/SkyMap/spherethetaphi.h

    r2960 r2968  
    119119void Pixelize(int_4);
    120120
     121virtual r_8  ThetaOfSlice(int_4 index) const;
    121122virtual void GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const;
    122123virtual void GetThetaSlice(int_4 index, r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const ;
  • trunk/SophyaLib/SkyMap/sphericalmap.h

    r2885 r2968  
    4747virtual void Resize(int_4 m)=0;
    4848virtual uint_4 NbThetaSlices() const=0;
     49virtual r_8  ThetaOfSlice(int_4 index) const=0;
    4950virtual void GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const=0;
    5051virtual void GetThetaSlice(int_4 sliceIndex, r_8& theta, r_8& phi0, TVector<int_4>& pixelIndices,TVector<T>& value) const=0 ;
Note: See TracChangeset for help on using the changeset viewer.