Changeset 2013 in Sophya for trunk/SophyaLib/SkyMap/localmap.h


Ignore:
Timestamp:
May 24, 2002, 4:54:53 PM (23 years ago)
Author:
lemeur
Message:

amelioration de la projection de localmap

File:
1 edited

Legend:

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

    r1624 r2013  
    1919
    2020
     21template <class T>
     22class FIO_LocalMap;
     23
     24template<class T>
     25class FITS_LocalMap;
     26
    2127/* Class LocalMap */
    2228
     
    2632{
    2733
     34 // friend declaration for classes which handle persistence and FITS IO
     35  friend class FIO_LocalMap<T>;
     36  friend class FITS_LocalMap<T>;
     37
    2838public:
    2939
    3040LocalMap();
    31 LocalMap(int_4 nx, int_4 ny);
     41LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0,int_4 x0,int_4 y0,double angle=0.);
     42LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0, double angle=0.);
    3243LocalMap(const LocalMap<T>& lm, bool share);
    3344LocalMap(const LocalMap<T>& lm);
     
    6980inline virtual char* TypeOfMap() const {return "LOCAL";};
    7081 
    71 virtual void SetOrigin(double theta=90.,double phi=0.,double angle=0.);
    72 virtual void SetOrigin(double theta,double phi,int_4 x0,int_4 y0,double angle=0.);
    73 
    74 virtual void SetSize(double angleX,double angleY);
    7582
    7683/*! Check to see if the local mapping is done */
    77 inline bool LocalMap_isDone() const {return(originFlag_ && extensFlag_);};
    78 
    79 virtual void Project(SphericalMap<T>& sphere) const;
     84  //inline bool LocalMap_isDone() const {return(originFlag_ && extensFlag_);};
     85
     86void PixThetaPhi(int_4 ip,int_4 it, double& theta,double& phi) const;
     87
     88
     89void ProjectionToSphere(SphericalMap<T>&) const;
    8090 
    8191/* There should be a more complex algorithm somewhere to combine *several* local maps to a full sphere.
     
    92102inline int_4 SizeY() const {return nSzY_;}
    93103
    94 inline void Origin(double& theta,double& phi,int_4& x0,int_4& y0,double& angle) const {theta= theta0_; phi= phi0_; x0= x0_; y0= y0_;angle= angle_;}
    95 
    96 inline void Aperture(double& anglex,double& angley) const {anglex= angleX_; angley= angleY_;}
     104inline void Origin(double& theta,double& phi,int_4& x0,int_4& y0,double& angle) const {theta= thetaDegresC_; phi= phiDegresC_; x0= x0_; y0= y0_;angle= angleDegres_;}
     105
     106/*! total aperture in theta and phi, in degrees ( from SetSize() ) */
     107inline void Aperture(double& anglex,double& angley) const {anglex= angleDegresX_; angley= angleDegresY_;}
    97108
    98109
    99110/*  Acces to the DataBlock  */
    100 inline       NDataBlock<T>& DataBlock()       {return pixels_;}
    101 inline const NDataBlock<T>& DataBlock() const {return pixels_;}
     111inline       NDataBlock<T>& DataBlock()       {return pixels_.DataBlock();}
     112inline const NDataBlock<T>& DataBlock() const {return pixels_.DataBlock();}
     113
     114/*  Acces to the matrix  */
     115//! access to matrix
     116/*!
     117  \warning : a pixel is defined by the pair of a phi-like index
     118   (x-axis) and a theta-like index (y-axis). The phi-like index denotes
     119   the column number in the matrix ; the theta-like index denotes the
     120   row number.
     121*/
     122inline       TMatrix<T>& Matrix()       {return pixels_;}
     123inline const TMatrix<T>& Matrix() const {return pixels_;}
    102124
    103125/* impression */
     
    156178
    157179void InitNul();
     180void SetOrigin(double theta=90.,double phi=0.,double angle=0.);
     181void SetOrigin(double theta,double phi,int_4 x0,int_4 y0,double angle=0.);
     182void SetSize(double angleX,double angleY);
     183void SetCoorC(double theta0, double phi0);
     184TMatrix<double> CalculMatricePassage();
    158185void Getij(int_4 k,int_4& i,int_4& j) const;
    159 void ReferenceToUser(double& theta,double& phi) const;
    160 void UserToReference(double& theta,double& phi) const;
    161 void PixProjToAngle(double x,double y,double& theta,double& phi) const;
    162 void AngleProjToPix(double theta,double phi,double& x,double& y) const;
     186  void PixToSphereC(int_4 ip, int_4 it, double& XP, double& YP, double& ZP) const;
    163187
    164188void recopierVariablesSimples(const LocalMap<T>& lm);
     
    167191// ---------- Variables internes ----------------------------
    168192
    169 int_4 nSzX_;
    170 int_4 nSzY_;
    171 int_4 nPix_;
    172 bool originFlag_;
    173 bool extensFlag_;
    174 int_4 x0_;
    175 int_4 y0_;
    176 double theta0_;
    177 double phi0_;
    178 double angle_;
    179 double cos_angle_;
    180 double sin_angle_;
    181 double angleX_;
    182 double angleY_;
    183 double tgAngleX_;
    184 double tgAngleY_;
    185 NDataBlock<T> pixels_;
     193
     194  // variables suffisantes pour reconstruire l'objet
     195
     196  int_4 nSzX_;
     197  int_4 nSzY_;
     198  double angleDegresX_;
     199  double angleDegresY_;
     200  double thetaDegresC_;
     201  double phiDegresC_;
     202  int_4 x0_;
     203  int_4 y0_;
     204  double angleDegres_;
     205
     206  //  NDataBlock<T> pixels_;
     207  TMatrix<T> pixels_;
     208
     209
     210  // variables derivees (redondantes, precalculees pour ameliorer
     211  // les performances)
     212
     213  int_4 nPix_;
     214
     215
     216  double thetaC_;
     217  double phiC_;
     218  double csthC_;
     219  double snthC_;
     220  double csphC_;
     221  double snphC_;
     222  double XC_;
     223  double YC_;
     224  double ZC_;
     225
     226
     227  double angle_;
     228  double cosAngle_;
     229  double sinAngle_;
     230  double deltaPhi_;
     231  double deltaTheta_;
     232
     233
     234
    186235};
    187236
Note: See TracChangeset for help on using the changeset viewer.