Changeset 2290 in Sophya for trunk


Ignore:
Timestamp:
Dec 5, 2002, 4:43:18 PM (23 years ago)
Author:
lemeur
Message:

documentation

Location:
trunk/SophyaLib/SkyMap
Files:
6 edited

Legend:

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

    r2198 r2290  
    1212/*!
    1313  \class SOPHYA::LocalMap
     14  \ingroup SkyMap
    1415  A local map is a 2 dimensional matrix, with ny rows and nx columns.
    15   The local map has an origin in (theta0, phi0), mapped to pixel(x0, y0)
    16  default value of (x0, y0) is middle of the map, center of pixel(nx/2, ny/2)
     16  The local map has a spatial origin with spherical coordinates (theta0, phi0), mapped to pixel(x0, y0). Default value of (x0, y0) is middle of the map, center of pixel(nx/2, ny/2).
     17
    1718 Each pixel(ip, it) is defined by its "phi-like" index ip (column
    1819 index in the matrix) and its "theta-like" index it (row index in
     
    2021 system ; index it is associated with y-axis in the same map-coordinate system.
    2122 
    22     The map is supposed to lie on a plan tangent to the celestial sphere
    23     at a point, with spherical coordinates (theta0, phi0), whose pixel
    24     numbers  are (x0,y0) in the local map. The aperture of the map is defined
    25     by two values of angles, angleX and angleY, covered respectively by all
    26     the pixels in x direction and all the pixels in y direction.
     23    The map is supposed to lie in a plan tangent to the celestial sphere
     24    at its origin, with spherical coordinates (theta0, phi0), whose pixel
     25    numbers  are (x0,y0) in the local map as indicated above. The aperture of the map is defined by two values of angles, angleX and angleY, covered respectively by all the pixels in x direction and all the pixels in y direction.
    2726
    2827    Each pixel has angleX/nx and angleY/ny, as angle extensions. So, in
     
    3534    (angles in radians)
    3635
    37     The projection (method : ProjectionToSphere() )of the map onto a
     36    The projection (method : ProjectionToSphere() ) of the map onto a
    3837    sphere is made by the following procedure :
    3938
    4039    the sphere is supposed to have radius=1. The map is
    41     considered to be tangent to the sphere, on a point with (theta0, phi0)
     40    considered to be tangent to the sphere, at a point with (theta0, phi0)
    4241    spherical coodinates. A reference coordinate system (plane-coordinate
    43     system) , is chosen in the plane of the map  with reference axes :
    44 
    45     x-axis : vector tengent to a parallel in (theta0, phi0) on the sphere
     42    system) , is chosen with respect to the plane of the map  with reference axes :
     43
     44    x-axis : vector tangent to a parallel at (theta0, phi0) on the sphere
    4645    (components in "3-dim cartesian system : -sin(phi0) ; cos(phi0) ; 0)
    4746
     
    4948             sin(theta0)*cos(phi0) ; sin(theta0*sin(phi0) ; cos(theta0)
    5049
    51     y-axis = z-axis^x-axis : tangent to the meridian at (theta0, phi0)
     50    y-axis : z-axis^x-axis : tangent to the meridian at (theta0, phi0)
     51
    5252
    5353    note that the map-coordinate system may be rotated with respect to
     
    5858    his coordinates  in the plane-coordinate system (computed from x,y
    5959    above, with eventual rotation), with the sphere.
     60
     61   In order to make an instance of this class  available, the user must either use the standard constructor LocalMap() (as well as the "full" constructor LocalMap() ) or use the "partial" constructor LocalMap() followed by call to SetSize() and SetOrigin() (for fixing links between the map and the celestial sphere.
     62
     63Example :
     64
     65\verbatim
     66  LocalMap<r_4>    lcm(300, 600, 10.,20., 90.,0.); // full cstr.
     67\endverbatim
     68
     69defining a local map 300X600 pixels, representing a sphere portion of angular apertures 10 degres x 20 degres, with map center located on the equator, is equivalent to :
     70
     71\verbatim
     72  LocalMap<r_4>    lcm(300, 600); // partial cstr.
     73  lcm.SetSize(10., 20.);
     74  lcm.SetOrigin(90., 0.);
     75\endverbatim
     76
     77as well as :
     78
     79
     80\verbatim
     81  LocalMap<r_4>    lcm(300, 600, 10.,20., 90.,0., 0, 0); // full cstr.
     82\endverbatim
     83
     84(same map, but with origin of coordinates at pixel (0,0) instead of (150, 300) as it was implicit above)
     85
     86is equivalent to :
     87
     88\verbatim
     89  LocalMap<r_4>    lcm(300, 600);
     90  lcm.SetSize(10., 20.);
     91lcm.SetOrigin(90., 0., 0,0);
     92\endverbatim
     93
     94
    6095*/
    6196template<class T>
     
    66101
    67102//! partial constructor of the local map
    68 /*!
     103/*! \fn void SOPHYA::LocalMap::LocalMap(int_4 nx, int_4 ny)
    69104  \param nx : number of pixels in x direction
    70105  \param ny : number of pixels in y direction
    71106
    72 must be followed by calling the methodsa setSize() and setOrigin() in order the object become usable
     107must be followed by calls to the methods  SetSize() and SetOrigin() in order the object become usable
    73108
    74109 */
    75 
    76110template<class T>
    77111LocalMap<T>::LocalMap(int_4 nx, int_4 ny) 
     
    86120
    87121//! full constructor of the local map
    88 /*!
     122/*! \fn void SOPHYA::LocalMap:::LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0,int_4 x0,int_4 y0,double angle)
    89123  \param nx : number of pixels in x direction
    90124  \param ny : number of pixels in y direction
     
    93127  \param theta0,phi0 : spherical coordinates of reference point at which
    94128                       the map is considered to be tangent to the sphere
    95   \param x0, y0 : coodinates (in pixels) of the reference point just defined
     129  \param x0, y0 : coordinates (in pixels) of the reference point just defined
    96130  \param angle : angle (degrees) of the rotation between x-axis of
    97131                 map-coordinate system) and the tangent to parallel on
     
    111145}
    112146
     147// void SOPHYA::LocalMap::LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0, double angle)
    113148
    114149//! standard constructor of the local map
    115 /*!
     150/*! \fn void SOPHYA::LocalMap::LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0, double angle)
    116151  \param nx : number of pixels in x direction
    117152  \param ny : number of pixels in y direction
     
    138173
    139174//! copy constructor
    140 /*!
     175/*! \fn void SOPHYA::LocalMap::LocalMap(const LocalMap<T>& lm, bool share)
    141176  \param share : if true, share data. If false copy data
    142177 */
     
    151186
    152187//! copy constructor
    153 /*!
     188/*! \fn void SOPHYA::LocalMap::LocalMap(const LocalMap<T>& lm)
    154189  \warning datas are \b SHARED with \b lm.
    155190  \sa TMatrix::TMatrix(const TMatrix<T>&)
     
    165200}
    166201
     202//! destructor
     203/*! \fn void SOPHYA::LocalMap::~LocalMap()
     204 
     205 */
    167206template<class T>
    168207LocalMap<T>::~LocalMap() {;}
     
    173212
    174213  Resize storage area for pixels
     214\param nx
     215\param ny  new pixel numbers
    175216*/
    176217template<class T>
     
    385426   \return (theta, phi) coordinates of pixel of map with indices (ip,it) corresponding to x and y directions
    386427
    387  \param ip : phi-like index
    388  \param it : theta-like index
     428 \param ip phi-like index
     429 \param it theta-like index
    389430*/
    390431
     
    416457 
    417458/*! \fn double SOPHYA::LocalMap::PixSolAngle(int_4 k) const
    418 
    419    Pixel Solid angle  (steradians)
    420 
    421    All the pixels are considered to have  the same size in (theta, phi).
     459   Pixel Solid angle  of pixel k (steradians).
     460   For the moment, all the pixels are considered to have  the same size in (theta, phi). So the parameter k is dummy.
    422461     
    423462*/ 
     
    440479}
    441480
    442 /*! \fn void SOPHYA::LocalMap::PixToSphereC(int_4 ip, int_4 it, double& XP, double& YP, double& ZP)
     481/*! \fn void SOPHYA::LocalMap::PixToSphereC(int_4 ip, int_4 it, double& XP, double& YP, double& ZP) const
    443482
    444483projection of a pixel of map, onto the unity sphere ; result in cartesian coordinates.
     
    469508
    470509/*! \fn void SOPHYA::LocalMap::SetOrigin(double theta0,double phi0,double angle)
    471 
    472510   set the referential of the map (angles in degrees)
    473511
    474     (default x0=siz_x/2,  y0=siz_y/2)
     512    \param theta0
     513    \param phi0 celestial coordinates attributed to center pixel:  x0=siz_x/2,  y0=siz_y/2
     514\param angle  angle between map referential and plane-coordinate system (see class description)
    475515*/
    476516template<class T>
     
    481521 
    482522/*!  \fn void SOPHYA::LocalMap::SetOrigin(double theta0,double phi0,int_4 x0,int_4 y0,double angle)
    483 
    484   set the referential of the map (angles in degrees)
     523   set the referential of the map (angles in degrees)
     524
     525    \param theta0
     526    \param phi0 celestial coordinates attributed to center pixel: (x0,y0)
     527\param angle  angle between map referential and plane-coordinate system (see class description)
     528
    485529*/
    486530template<class T>
     
    598642
    599643   angle range of tthe map (angles in degrees)
     644\param angleX phi-like angle
     645\param angleX theta-like angle
    600646*/
    601647template<class T>
     
    780826
    781827
    782 //! Fill a LocalMap with a constant value \b a
     828/*!  \fn void SOPHYA::LocalMap::SetT(T a)
     829 Fill a LocalMap with a constant value \b a
     830 */
    783831template <class T>
    784832LocalMap<T>& LocalMap<T>::SetT(T a)
     
    790838}
    791839
    792 /*! Add a constant value \b x to a LocalMap */
     840/*!  \fn void SOPHYA::LocalMap::Add(T a)
     841Add a constant value \b x to a LocalMap
     842 */
    793843template <class T>
    794844LocalMap<T>& LocalMap<T>::Add(T a)
     
    800850}
    801851
    802 /*! Substract a constant value \b a to a LocalMap */
     852/*!  \fn void SOPHYA::LocalMap::Sub(T a,bool fginv)
     853
     854Substract a constant value \b a to a LocalMap
     855
     856*/
    803857template <class T>
    804858LocalMap<T>& LocalMap<T>::Sub(T a,bool fginv)
     
    810864}
    811865
    812 /*! multiply a LocalMap by a constant value \b a */
     866/*! \fn void SOPHYA::LocalMap::Mul(T a)
     867mutiply a LocalMap by a constant value \b a
     868*/
    813869template <class T>
    814870LocalMap<T>& LocalMap<T>::Mul(T a)
     
    820876}
    821877
    822 /*! divide a LocalMap by a constant value \b a */
     878/*! \fn void SOPHYA::LocalMap::Div(T a)
     879divide a LocalMap by a constant value \b a
     880*/
    823881template <class T>
    824882LocalMap<T>& LocalMap<T>::Div(T a)
     
    831889
    832890//  >>>> Operations avec 2nd membre de type LocalMap
    833 //! Add two LocalMap
    834 
     891/*! \fn void SOPHYA::LocalMap::AddElt(const LocalMap<T>& a)
     892Add two LocalMap
     893 */
    835894template <class T>
    836895LocalMap<T>& LocalMap<T>::AddElt(const LocalMap<T>& a)
     
    844903}
    845904
    846 //! Substract two LocalMap
     905/*! \fn void SOPHYA::LocalMap::SubElt(const LocalMap<T>& a)
     906Substract two LocalMap
     907 */
    847908template <class T>
    848909LocalMap<T>& LocalMap<T>::SubElt(const LocalMap<T>& a)
     
    856917}
    857918
    858 //! Multiply two LocalMap (elements by elements)
     919/*! \fn void SOPHYA::LocalMap::MulElt(const LocalMap<T>& a)
     920Multiply two LocalMap (elements by elements)
     921 */
    859922template <class T>
    860923LocalMap<T>& LocalMap<T>::MulElt(const LocalMap<T>& a)
     
    869932}
    870933
    871 //! Divide two LocalMaps (elements by elements) - No protection for divide by 0
     934/*! \fn void SOPHYA::LocalMap::DivElt(const LocalMap<T>& a)
     935Divide two LocalMaps (elements by elements) - No protection for divide by 0
     936*/
    872937template <class T>
    873938LocalMap<T>& LocalMap<T>::DivElt(const LocalMap<T>& a)
  • trunk/SophyaLib/SkyMap/localmap.h

    r2198 r2290  
    6969virtual T& PixVal(int_4 k);
    7070virtual T const& PixVal(int_4 k) const;
    71 
     71  //! if fg = true, will generate  exceptions , when theta-phi out of range
    7272inline  void SetThrowExceptionWhenOutofMapFlag(bool fg = false) { exc_outofmap_ = fg; }
    73 // true --> Genere des exceptions si theta-phi out of range , sinon, index a -1
     73
     74//! true --> exceptions wil be active when theta-phi out of range
    7475inline  bool GetThrowExceptionWhenOutofMapFlag() { return exc_outofmap_; }
    7576
    7677virtual bool ContainsSph(double theta, double phi) const;
     78//! return pixel number correspoinding to (theta,phi)
    7779virtual int_4 PixIndexSph(double theta,double phi) const;
    7880   
     81//! return (theta,phi) correspoinding to pixel number k
    7982virtual void PixThetaPhi(int_4 k,double& theta,double& phi) const;
    8083
     84//! set all pixel values equal to v
    8185virtual T SetPixels(T v);
    8286
     87// return the solid angle covered by pixel k (steradians)
    8388virtual double PixSolAngle(int_4 k) const;
    8489
     
    9196void SetSize(double angleX,double angleY);
    9297
    93 
    94 inline virtual char* TypeOfMap() const {return "LOCAL";};
     98  /*! \fn TypeOfMap()
     99 return the string "LOCAL"
     100  */
     101inline virtual string TypeOfMap() const {return string("LOCAL");};
    95102 
    96103
     
    152159inline  LocalMap<T>& operator = (T a) {return SetT(a);}
    153160
    154 //! Add \b x to all elements
     161// Add \b x to all elements
    155162virtual LocalMap<T>& Add(T a);
    156163inline  LocalMap<T>&  operator += (T x)  { return Add(x); }
    157 //! Substract \b x to all elements
     164// Substract \b x to all elements
    158165virtual LocalMap<T>& Sub(T a,bool fginv=false);
    159166inline   LocalMap<T>&  operator -= (T x)  { return Sub(x); }
    160 //! Multiply all elements by \b x
     167// Multiply all elements by \b x
    161168virtual LocalMap<T>& Mul(T a);
    162169inline  LocalMap<T>&  operator *= (T x)  { return Mul(x); }
    163 //! Divide all elements by \b x
     170// Divide all elements by \b x
    164171virtual LocalMap<T>& Div(T a);
    165172inline  LocalMap<T>&  operator /= (T x)  { return Div(x); }
  • trunk/SophyaLib/SkyMap/pixelmap.h

    r1419 r2290  
    7070*/             
    7171virtual int_4 SizeIndex() const=0;
    72 virtual char* TypeOfMap() const =0;
     72virtual string TypeOfMap() const =0;
    7373
    7474/*! Pixel  (steradians) */
  • trunk/SophyaLib/SkyMap/spherehealpix.cc

    r1624 r2290  
    576576SphereHEALPix<T>& SphereHEALPix<T>::Add(T a)
    577577 {
     578   cout << " c'est mon Add " << endl;
    578579  if (NbPixels() < 1)
    579580    throw RangeCheckError("SphereHEALPix<T>::Add(T )  - SphereHEALPix not dimensionned ! ");
    580   pixels_ += a;
     581  //   pixels_ += a;
     582   pixels_.Add(a);
    581583  return (*this);
    582584}
  • trunk/SophyaLib/SkyMap/spherehealpix.h

    r1624 r2290  
    103103at the moment, always RING
    104104*/
    105 inline virtual char* TypeOfMap() const {return "RING";};
     105inline virtual string TypeOfMap() const {return string("RING");};
    106106
    107107
     
    147147//! Add \b x to all elements
    148148virtual SphereHEALPix<T>& Add(T a);
    149 inline  SphereHEALPix<T>&  operator += (T x)  { return Add(x); }
     149inline  SphereHEALPix<T>&  operator += (T x)  { pixels_ += x; return *this; }
    150150//! Substract \b x to all elements
    151151virtual SphereHEALPix<T>& Sub(T a,bool fginv=false);
    152 inline   SphereHEALPix<T>&  operator -= (T x)  { return Sub(x); }
     152inline   SphereHEALPix<T>&  operator -= (T x)  { pixels_ -= x; return *this; }
    153153//! Multiply all elements by \b x
    154154virtual SphereHEALPix<T>& Mul(T a);
    155 inline  SphereHEALPix<T>&  operator *= (T x)  { return Mul(x); }
     155inline  SphereHEALPix<T>&  operator *= (T x)  {pixels_ *= x; return *this; }
    156156//! Divide all elements by \b x
    157157virtual SphereHEALPix<T>& Div(T a);
    158 inline  SphereHEALPix<T>&  operator /= (T x)  { return Div(x); }
     158inline  SphereHEALPix<T>&  operator /= (T x)  {pixels_ /= x; return *this; }
    159159
    160160// A += -=  (ajoute, soustrait element par element les deux spheres )
  • trunk/SophyaLib/SkyMap/spherethetaphi.h

    r2198 r2290  
    110110virtual void Resize(int_4 m);
    111111
    112 inline virtual char* TypeOfMap() const {return "TETAFI";};
     112inline virtual string TypeOfMap() const {return string("TETAFI");};
    113113
    114114/* Valeurs de theta des paralleles et phi des meridiens limitant le pixel d'indice k */
Note: See TracChangeset for help on using the changeset viewer.