Changeset 568 in Sophya for trunk/SophyaLib/Samba/localmap.cc


Ignore:
Timestamp:
Nov 10, 1999, 3:17:10 PM (26 years ago)
Author:
ansari
Message:

ajout doc GLM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/localmap.cc

    r518 r568  
    4040//    pixel(nx/2, ny/2)
    4141//
    42 //    la carte est consideree comme un tableau a deux indices i et j, i etant
    43 //    indice de colonne et j indice de ligne. La carte est supposee resider
    44 //    dans un plan tangent, dont le point de tangence est repere (x0,y0) dans
    45 //    la carte et (theta0, phi0) sur la sphere celeste. L'extension de la
    46 //    carte est definie par les valeurs de deux angles couverts respectivement
    47 //    par la totalite des pixels en x de la carte et la totalite des pixels
    48 //    en y. (SetSize()).
    49 //    On considere un "plan de reference" : plan tangent a la sphere celeste
    50 //    aux angles theta=Pi/2 et phi=0. Dans ce plan L'origine des coordonnees
    51 //    est le point de tangence. L'axe Ox est la tangente parallele a
    52 //    l'equateur, dirige vers les phi croissants, l'axe Oy est parallele
    53 //    au meridien, dirige vers le pole nord.
    54 //    De maniere interne a la classe une carte est definie dans ce plan de
    55 //    reference et transportee  jusqu'au point (theta0, phi0) de sorte que
    56 //    les axes restent paralleles aux meridiens et paralleles. L'utilisateur
    57 //    peut definir sa carte selon un repere en rotation par rapport au repere
    58 //    de reference (par l'angle entre le parallele et l'axe Ox souhaite --
    59 //    methode SetOrigin(...))
     42//    A local map is a 2 dimensional array, with i as column index and j
     43//    as row index. The map is supposed to lie on a plan tangent to the
     44//    celestial sphere in a point whose coordinates are (x0,y0) on the local
     45//    map and (theta0, phi0) on the sphere. The range of the map is defined
     46//    by two values of angles covered respectively by all the pixels in
     47//    x direction and all the pixels in y direction (SetSize()).
     48//
     49//    A "reference plane" is considered : this plane is tangent to the
     50//    celestial sphere in a point with angles theta=Pi/2 and phi=0. This
     51//    point is the origine of coordinates is of the reference plane. The
     52//    x-axis is the tangent parallel to the equatorial line and oriented
     53//    toward the increasing phi's ; the y-axis is parallel to the meridian
     54//    line and oriented toward the north pole.
     55//   
     56//    Internally, a map is first defined within this reference plane and
     57//    tranported until the point (theta0, phi0) in such a way that both
     58//    axes are kept parallel to meridian and parallel lines of the sphere.
     59//    The user can define its own map with axes rotated with respect to
     60//    reference axes (this rotation is characterized by angle between
     61//    the local parallel line and the wanted x-axis-- see method
     62//    SetOrigin(...))
     63//   
     64//
    6065
    6166//
     
    7075//++
    7176//
    72 // Links        Descendants
     77// Links        Childs
    7378//
    7479//     
    7580//--
    7681//++
    77 // Titre        Constructeurs
     82// Titre        Constructors
    7883//--
    7984//++
     
    8186LocalMap<T>::LocalMap()
    8287//
    83 // Constructeur par defaut
     88//    
    8489//--
    8590{
     
    9196LocalMap<T>::LocalMap(int nx, int ny) : nSzX_(nx), nSzY_(ny)
    9297//
    93 // Constructeur
     98//    
    9499//--
    95100{
     
    104109LocalMap<T>::LocalMap(const LocalMap<T>& lm)
    105110//
    106 // Constructeur de recopie
     111//    copy constructor
    107112//--
    108113{
     
    130135
    131136//++
     137// Titre        Destructor
     138//--
     139//++
    132140template<class T>
    133141LocalMap<T>::~LocalMap()
    134142//
    135 // Destructeur
    136143//--
    137144{
     
    139146}
    140147
    141 //++
    142 template<class T>
    143 void LocalMap<T>::InitNul()
    144 //
    145 // Initialise à zéro certaines variables internes
    146 //--
    147 {
    148   originFlag_= false;
    149   extensFlag_= false;
    150   cos_angle_= 1.0;
    151   sin_angle_= 0.0;
    152   pixels_.Reset();
    153 }
     148
     149
     150//++
     151// Titre        Public Methods
     152//--
    154153
    155154//++
     
    157156void LocalMap<T>::ReSize(int nx, int ny)
    158157//
    159 // Redimensionne l'espace de stokage des pixels
     158//    Resize storage area for pixels
    160159//--
    161160{
     
    169168
    170169//++
    171 // Titre        Methodes
    172 //--
    173 
    174 
    175 //++
    176170template<class T>
    177171int LocalMap<T>::NbPixels() const
    178172//
    179 //    Retourne le nombre de pixels du découpage
     173//    Return number of pixels
    180174//--
    181175{
     
    187181T& LocalMap<T>::PixVal(int k)
    188182//
    189 //    Retourne la valeur du contenu du pixel d'indice k
     183//    Return value of pixel with index k
    190184//--
    191185{
     
    205199T const& LocalMap<T>::PixVal(int k) const
    206200//
    207 //    Retourne la valeur du contenu du pixel d'indice k
     201//   const version of previous method
    208202//--
    209203{
     
    220214//++
    221215template<class T>
    222 bool LocalMap<T>::ContainsSph(double theta, double phi) const
    223 //--
    224 {
    225   return(true);  // $CHECK$  A MODIFIER - Reza 26/10/99
    226 }
    227 
    228 //++
    229 template<class T>
    230216int LocalMap<T>::PixIndexSph(double theta,double phi) const
    231217//
    232 //    Retourne l'indice du pixel vers lequel pointe une direction définie par
    233 //    ses coordonnées sphériques
     218//    Return index of the pixel with spherical coordinates (theta,phi)
    234219//--
    235220{
     
    275260void LocalMap<T>::PixThetaPhi(int k,double& theta,double& phi) const
    276261//
    277 //    Retourne les coordonnées (theta,phi) du milieu du pixel d'indice k
     262//    Return (theta, phi) coordinates of pixel with index k
    278263//--
    279264{
     
    302287double LocalMap<T>::PixSolAngle(int k) const
    303288//
    304 // Pixel Solid angle  (steradians)
    305 // All the pixels have not necessarly the same size in (theta, phi)
    306 // because of the projection scheme which is not yet fixed.   
     289//    Pixel Solid angle  (steradians)
     290//    All the pixels have not necessarly the same size in (theta, phi)
     291//    because of the projection scheme which is not yet fixed.   
    307292//--
    308293{
     
    339324void LocalMap<T>::SetOrigin(double theta0,double phi0,double angle)
    340325//
    341 // Fixe la repere de reference ( angles en degres)
     326//    set the referential of the map (angles in degrees)
     327//    (default x0=siz_x/2,  y0=siz_y/2)
    342328//--
    343329{
     
    357343void LocalMap<T>::SetOrigin(double theta0,double phi0,int x0,int y0,double angle)
    358344//
    359 // Fixe le repere de reference (angles en degres) 
     345//    set the referential of the map (angles in degrees)
    360346//--
    361347{
     
    375361void LocalMap<T>::SetSize(double angleX,double angleY)
    376362//
    377 // Fixe l'extension de la carte (angles en degres)
     363//    angle range of tthe map (angles in degrees)
    378364//--
    379365{
     
    393379void LocalMap<T>::Project(SphericalMap<T>& sphere) const
    394380//
    395 // Projection to spherical map   
     381//    Projection to a spherical map   
    396382//--
    397383{
     
    404390    }
    405391}
     392// Titre        Private Methods
     393//++
     394template<class T>
     395void LocalMap<T>::InitNul()
     396//
     397//    set some attributes to zero
     398//--
     399{
     400  originFlag_= false;
     401  extensFlag_= false;
     402  cos_angle_= 1.0;
     403  sin_angle_= 0.0;
     404  pixels_.Reset();
     405}
    406406
    407407//++
     
    409409void LocalMap<T>::Getij(int k,int& i,int& j) const
    410410//
     411//    Return 2 indices corresponding to the pixel number k
    411412//--
    412413{
     
    420421void  LocalMap<T>::ReferenceToUser(double& theta,double& phi) const
    421422//
    422 // --     
     423//    Transform a pair of coordinates (theta, phi) given in
     424//    reference coordinates into map coordinates
     425//--     
    423426{
    424427  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi)
     
    457460void  LocalMap<T>::UserToReference(double& theta,double& phi) const
    458461//
    459 // --     
     462//    Transform a pair of coordinates (theta, phi) given in
     463//    map coordinates into reference coordinates
     464//--     
    460465{
    461466  if(theta > Pi || theta < 0. || phi < 0. || phi >= 2*Pi)
     
    498503void LocalMap<T>::PixProjToAngle(double x,double y,double& theta,double& phi) const
    499504//
    500 // (x,y) representent les coordonnees en unites de pixels d'un point DANS LE PLAN DE REFERENCE.
    501 // On recupere (theta,phi) par rapport au repere "absolu" theta=pi/2 et phi=0.
     505// 
     506//    Given coordinates in pixel units in the REFERENCE PLANE, return
     507//    (theta, phi) in "absolute" referential theta=pi/2 ,phi=0.   
    502508//--
    503509{
     
    511517void LocalMap<T>::AngleProjToPix(double theta,double phi,double& x,double& y) const
    512518//
    513 // (theta,phi) par rapport au repere "absolu" theta=pi/2,phi=0. On recupere
    514 // (i,j)  DANS LE PLAN DE REFERENCE.
     519//    Given coordinates  (theta, phi) in "absolute" referential
     520//    theta=pi/2 ,phi=0  return pixel indices  (i,j) in the REFERENCE PLANE.
    515521//--
    516522{
     
    542548  os << endl;
    543549}
     550//++
     551// Titre        class FIO_LocalMap
     552//    Delegated objects for persitance management
     553//--
    544554
    545555//*******************************************************************
     
    548558//*******************************************************************
    549559
     560//++
    550561template <class T>
    551562FIO_LocalMap<T>::FIO_LocalMap()
     563//
     564//--
    552565{
    553566  dobj= new LocalMap<T>;
    554567  ownobj= true;
    555568}
    556 
     569//++
    557570template <class T>
    558571FIO_LocalMap<T>::FIO_LocalMap(string const& filename)
     572//
     573//--
    559574{
    560575  dobj= new LocalMap<T>;
     
    563578}
    564579
     580//++
    565581template <class T>
    566582FIO_LocalMap<T>::FIO_LocalMap(const LocalMap<T>& obj)
     583//
     584//--
    567585{
    568586  dobj= new LocalMap<T>(obj);
     
    577595}
    578596
     597//++
    579598template <class T>
    580599FIO_LocalMap<T>::~FIO_LocalMap()
     600//
     601//--
    581602{
    582603  if (ownobj && dobj) delete dobj;
    583604}
    584 
     605//++
    585606template <class T>
    586607AnyDataObj* FIO_LocalMap<T>::DataObj()
     608//
     609//--
    587610{
    588611  return(dobj);
    589612}
    590613
     614//++
    591615template <class T>
    592616void FIO_LocalMap<T>::ReadSelf(PInPersist& is)
    593 {
    594   cout << " FIO_LocalMap:: ReadSelf " << endl;
     617//
     618//--
     619{
    595620
    596621  if(dobj == NULL)
     
    598623      dobj= new LocalMap<T>;
    599624    }
    600 
    601 // Let's Read the SphereCoordSys object  -- ATTENTIOn - $CHECK$
    602   SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject());
    603   dobj->SetCoordSys(cs);
    604625
    605626  // Pour savoir s'il y avait un DVList Info associe
     
    652673}
    653674
     675//++
    654676template <class T>
    655677void FIO_LocalMap<T>::WriteSelf(POutPersist& os) const
    656 {
    657   cout << " FIO_LocalMap:: WriteSelf " << endl;
    658 
     678//
     679//--
     680{
    659681  if(dobj == NULL)
    660682    {
    661       cout << " WriteSelf:: dobj= null " << endl;
     683      cout << " FIO_LocalMap::WriteSelf:: dobj= null " << endl;
    662684      return;
    663685    }
    664686
    665 // Let's write the SphereCoordSys object
    666   dobj->GetCoordSys()->Write(os);
    667  
    668687  char strg[256];
    669688  int nSzX= dobj->Size_x();
Note: See TracChangeset for help on using the changeset viewer.