Ignore:
Timestamp:
Jun 1, 2006, 4:35:47 PM (19 years ago)
Author:
ansari
Message:

petites corrections + doc(xygen) / Protection Resize() ds SphereHEALPix et SphereThetaPhi - Reza 1/06/2006

File:
1 edited

Legend:

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

    r2885 r2960  
    6060/* --Methode-- */
    6161
    62 //++
     62/*! 
     63  \brief Constructor with specification of number of slices (in a hemisphere)
     64  \param m is the number of slices in theta on an hemisphere (the polar cap
     65  forms the first slice).
     66*/
    6367template <class T>
    6468SphereThetaPhi<T>::SphereThetaPhi(int_4 m)
    65 
    66 //    m is the number of slices in theta on an hemisphere (the polar cap
    67 //    forms the first slice).
    68 //--
    6969{
    7070  InitNul();
     
    7272}
    7373
     74//! Copy constructor (shares the pixel data if share==true)
    7475template <class T>
    7576SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s, bool share)
     
    8485}
    8586
     87//! Copy constructor (shares the pixel data)
    8688template <class T>
    8789SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s)
     
    105107{}
    106108
    107 //++
    108 // Titre        Public Méthods
    109 //--
    110109template <class T>
    111110void SphereThetaPhi<T>::InitNul()
     
    118117
    119118
    120 //++
     119//!   re-pixelize the sphere if (m > 0)
    121120template <class T>
    122121void SphereThetaPhi<T>::Resize(int_4 m)
    123 //   re-pixelize the sphere
    124 //--
    125 {
     122{
     123  if ((m <= 0) && (NTheta_ > 0) ) {
     124    cout << "SphereThetaPhi<T>::Resize(m) with m<=0 - NOT resized" << endl;
     125    return;
     126  }
    126127  InitNul();
    127128  Pixelize(m);
    128129}
    129130
     131//! Clone or share the SphereThetaPhi object \b a
    130132template<class T>
    131133void  SphereThetaPhi<T>::CloneOrShare(const  SphereThetaPhi<T>& a)
     
    142144  if (a.mInfo_) this->mInfo_ = new DVList(*(a.mInfo_));
    143145}
     146//! Share the pixel data with object \b a
    144147template<class T>
    145148void  SphereThetaPhi<T>::Share(const  SphereThetaPhi<T>& a)
     
    158161
    159162////////////////////////// methodes de copie/share
     163//! Perform data copy or shares the data
    160164template<class T>
    161165SphereThetaPhi<T>& SphereThetaPhi<T>::Set(const SphereThetaPhi<T>& a)
     
    176180}
    177181
     182//! Perform data copy or shares the data
    178183template<class T>
    179184SphereThetaPhi<T>& SphereThetaPhi<T>::CopyElt(const SphereThetaPhi<T>& a)
     
    197202
    198203/* --Methode-- */
    199 //++
     204//!    Return total number of pixels
    200205template <class T>
    201206int_4 SphereThetaPhi<T>::NbPixels() const
    202 
    203 //    Return total number of pixels
    204 //--
    205207{
    206208  return(NPix_);
     
    208210
    209211/* --Methode-- */
    210 //++
     212//!    Return value of pixel with index k
    211213template <class T>
    212214T& SphereThetaPhi<T>::PixVal(int_4 k)
    213 
    214 //    Return value of pixel with index k
    215 //--
    216215{
    217216  if((k < 0) || (k >= NPix_))
     
    222221}
    223222
    224 //++
     223//!    Return value of pixel with index k
    225224template <class T>
    226225T const& SphereThetaPhi<T>::PixVal(int_4 k) const
    227 
    228 //    Return value of pixel with index k
    229 //--
    230226{
    231227  if((k < 0) || (k >= NPix_))
     
    237233
    238234/* --Methode-- */
    239 //++
     235//! Return true if teta,phi in map 
    240236template <class T>
    241237bool SphereThetaPhi<T>::ContainsSph(double /*theta*/, double /*phi*/) const
    242 //--
    243238{
    244239  return(true);
     
    246241
    247242/* --Methode-- */
    248 //++
     243//!    Return index of the pixel corresponding to direction (theta, phi).
    249244template <class T>
    250245int_4 SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
    251 
    252 //    Return index of the pixel corresponding to
    253 //    direction (theta, phi).
    254 //--
    255246{
    256247  double dphi;
     
    275266
    276267/* --Methode-- */
    277 //++
     268//!   Return (theta,phi) coordinates of middle of  pixel with  index k
    278269template <class T>
    279270void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
    280 
    281 //   Return (theta,phi) coordinates of middle of  pixel with  index k
    282 //--
    283271{
    284272  int i;
     
    302290}
    303291
     292//! Setting pixel values to a constant
    304293template <class T>
    305294T SphereThetaPhi<T>::SetPixels(T v)
     
    309298}
    310299
    311 //++
     300/*!
     301  \brief Pixel Solid angle  (steradians)
     302  All the pixels have the same solid angle. The dummy argument is
     303  for compatibility with eventual pixelizations which would not
     304  fulfil this requirement.
     305*/
    312306template <class T>
    313307double SphereThetaPhi<T>::PixSolAngle(int_4 /*dummy*/) const
    314308
    315 //    Pixel Solid angle  (steradians)
    316 //    All the pixels have the same solid angle. The dummy argument is
    317 //    for compatibility with eventual pixelizations which would not
    318 //    fulfil this requirement.
    319 //--
    320309{
    321310  return Omega_;
     
    323312
    324313/* --Methode-- */
    325 //++
     314//!   Return values of theta,phi which limit the pixel with  index k
    326315template <class T>
    327316void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax)
    328 
    329 //   Return values of theta,phi which limit the pixel with  index k
    330 //--
    331317  {
    332318  int j;
     
    376362
    377363/* --Methode-- */
    378 //++
     364//!    Return number of theta-slices on the sphere
    379365template <class T>
    380366uint_4 SphereThetaPhi<T>::NbThetaSlices() const
    381 
    382 //    Return number of theta-slices on the sphere
    383 //--
    384367{
    385368  if (NTheta_<=0)
     
    391374
    392375/* --Methode-- */
    393 //++
     376//!    Return number of pixels along the phi-direction of the kt-th slice
    394377template <class T>
    395378int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const
    396 
    397 //    Return number of pixels in phi-direction of the kt-th slice
    398 //--
    399379{
    400380  int nbpix; 
     
    414394
    415395/* --Methode-- */
    416 //++
     396//!    Return  theta values which limit the slice kt
    417397template <class T>
    418398void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax)
    419 
    420 //    Return  theta values which limit the slice kt
    421 //--
    422399{
    423400  bool fgzn= false;
     
    446423
    447424/* --Methode-- */
    448 //++
     425//!   Return values of phi which limit the jp-th pixel of the kt-th slice
    449426template <class T>
    450427void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax)
    451 
    452 //   Return values of phi which limit the jp-th pixel of the kt-th slice
    453 //--
    454428{
    455429  // verification
     
    477451
    478452/* --Methode-- */
    479 //++
     453//!    Return pixel index  with sequence index jp in the slice kt
    480454template <class T>
    481455int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const
    482 
    483 //    Return pixel index  with sequence index jp in the slice kt
    484 //--
    485456{
    486457  int k;
     
    510481
    511482/* --Methode-- */
    512 //++
     483//!    Return indices kt (theta) and jp (phi) of  pixel with index k
    513484template <class T>
    514485void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp)
    515 
    516 //    Return indices kt (theta) and jp (phi) of  pixel with index k
    517 //--
    518486{
    519487  bool fgzn= false; 
     
    538506  else jp= k-TNphi_(i); 
    539507}
    540 //++
     508/*!
     509  \brief achieve the splitting into pixels
     510  m has the same signification as for the constructor
     511 
     512  Each theta-slice of the north hemisphere will be spitted starting f
     513  from  phi=0 ...
     514 
     515  South hemisphere is scanned in the same direction according to phi
     516  and from equator to the pole (the pixel following the last one of
     517  the slice closest to the equator with z>0, is the pixel with lowest
     518  phi of the slice closest of the equator with z<0).
     519*/
    541520template <class T>
    542521void  SphereThetaPhi<T>::Pixelize(int_4 m)
    543522
    544 //    achieve the splitting into pixels (m has the same signification
    545 //    as for the constructor)
    546 //
    547 //    Each theta-slice of the north hemisphere will be spitted starting f
    548 //    from  phi=0 ...
    549 //
    550 //    South hemisphere is scanned in the same direction according to phi
    551 //    and from equator to the pole (the pixel following the last one of
    552 //    the slice closest to the equator with z>0, is the pixel with lowest
    553 //    phi of the slice closest of the equator with z<0).
    554523//--
    555524{
     
    557526 
    558527  // Decodage et controle des arguments d'appel :
    559   // au moins 2 et au plus 16384 bandes d'un hemisphere en theta
     528  // au moins 2 et au plus 524288 bandes d'un hemisphere en theta
    560529  if (m < 2) m = 2;
    561   if (m > 16384) m = 16384;
     530  if (m > 524288) m = 524288;
    562531 
    563532  // On memorise les arguments d'appel
     
    623592}
    624593
    625 //++
     594
     595/*!   
     596  \brief return a Theta slice information
     597  For a theta-slice with index 'index', return :
     598  the corresponding "theta"
     599  a vector containing the phi's of the pixels of the slice
     600  a vector containing the corresponding values of pixels
     601*/
    626602template <class T>
    627603void SphereThetaPhi<T>::GetThetaSlice(int_4 index,r_8& theta, TVector<r_8>& phi, TVector<T>& value) const
    628 
    629 //    For a theta-slice with index 'index', return :
    630 //    the corresponding "theta"
    631 //    a vector containing the phi's of the pixels of the slice
    632 //    a vector containing the corresponding values of pixels
    633 //--
    634604
    635605{
     
    656626}
    657627
    658 //++
     628/*
     629  \brief return information on a theta slice
     630  For a theta-slice with index 'index', return :
     631  the corresponding "theta"
     632  the corresponding "phi" for first pixel of the slice
     633  a vector containing the indices of the pixels of the slice
     634  (equally distributed in phi)
     635  a vector containing the corresponding values of pixels
     636*/
    659637template <class T>
    660638void SphereThetaPhi<T>::GetThetaSlice(int_4 index,r_8& theta, r_8& phi0,TVector<int_4>& pixelIndices, TVector<T>& value) const
    661 
    662 //    For a theta-slice with index 'index', return :
    663 //    the corresponding "theta"
    664 //    the corresponding "phi" for first pixel of the slice
    665 //    a vector containing the indices of the pixels of the slice
    666 //    (equally distributed in phi)
    667 //    a vector containing the corresponding values of pixels
    668 //--
    669639
    670640{
Note: See TracChangeset for help on using the changeset viewer.