Changeset 2013 in Sophya for trunk/SophyaLib/SkyMap/localmap.h
- Timestamp:
- May 24, 2002, 4:54:53 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/localmap.h
r1624 r2013 19 19 20 20 21 template <class T> 22 class FIO_LocalMap; 23 24 template<class T> 25 class FITS_LocalMap; 26 21 27 /* Class LocalMap */ 22 28 … … 26 32 { 27 33 34 // friend declaration for classes which handle persistence and FITS IO 35 friend class FIO_LocalMap<T>; 36 friend class FITS_LocalMap<T>; 37 28 38 public: 29 39 30 40 LocalMap(); 31 LocalMap(int_4 nx, int_4 ny); 41 LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0,int_4 x0,int_4 y0,double angle=0.); 42 LocalMap(int_4 nx, int_4 ny, double angleX,double angleY, double theta0,double phi0, double angle=0.); 32 43 LocalMap(const LocalMap<T>& lm, bool share); 33 44 LocalMap(const LocalMap<T>& lm); … … 69 80 inline virtual char* TypeOfMap() const {return "LOCAL";}; 70 81 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);75 82 76 83 /*! 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 86 void PixThetaPhi(int_4 ip,int_4 it, double& theta,double& phi) const; 87 88 89 void ProjectionToSphere(SphericalMap<T>&) const; 80 90 81 91 /* There should be a more complex algorithm somewhere to combine *several* local maps to a full sphere. … … 92 102 inline int_4 SizeY() const {return nSzY_;} 93 103 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_;} 104 inline 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() ) */ 107 inline void Aperture(double& anglex,double& angley) const {anglex= angleDegresX_; angley= angleDegresY_;} 97 108 98 109 99 110 /* Acces to the DataBlock */ 100 inline NDataBlock<T>& DataBlock() {return pixels_;} 101 inline const NDataBlock<T>& DataBlock() const {return pixels_;} 111 inline NDataBlock<T>& DataBlock() {return pixels_.DataBlock();} 112 inline 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 */ 122 inline TMatrix<T>& Matrix() {return pixels_;} 123 inline const TMatrix<T>& Matrix() const {return pixels_;} 102 124 103 125 /* impression */ … … 156 178 157 179 void InitNul(); 180 void SetOrigin(double theta=90.,double phi=0.,double angle=0.); 181 void SetOrigin(double theta,double phi,int_4 x0,int_4 y0,double angle=0.); 182 void SetSize(double angleX,double angleY); 183 void SetCoorC(double theta0, double phi0); 184 TMatrix<double> CalculMatricePassage(); 158 185 void 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; 163 187 164 188 void recopierVariablesSimples(const LocalMap<T>& lm); … … 167 191 // ---------- Variables internes ---------------------------- 168 192 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 186 235 }; 187 236
Note:
See TracChangeset
for help on using the changeset viewer.