Changeset 568 in Sophya for trunk/SophyaLib/Samba/localmap.h
- Timestamp:
- Nov 10, 1999, 3:17:10 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/localmap.h
r518 r568 10 10 #include "ppersist.h" 11 11 12 // A local map of a region of the sky, in cartesian coordinates. 13 // It has an origin in (theta0, phi0), mapped to pixel(x0, y0) 14 // (x0, y0 might be outside of this local map) 15 // default value of (x0, y0) is middle of the map, center of pixel(nx/2, ny/2) 12 //! A local map of a region of the sky, in cartesian coordinates. 13 /*! A local map has an origin in (theta0, phi0), mapped to pixel(x0, y0) 14 (x0, y0 might be outside of this local map) 15 default value of (x0, y0) is middle of the map, center of pixel(nx/2, ny/2) 16 A local map is a 2 dimensional array, with i as column index and j 17 as row index. The map is supposed to lie on a plan tangent to the 18 celestial sphere in a point whose coordinates are (x0,y0) on the local 19 map and (theta0, phi0) on the sphere. The range of the map is defined 20 by two values of angles covered respectively by all the pixels in 21 x direction and all the pixels in y direction (SetSize()). 22 23 A "reference plane" is considered : this plane is tangent to the 24 celestial sphere in a point with angles theta=Pi/2 and phi=0. This 25 point is the origine of coordinates is of the reference plane. The 26 x-axis is the tangent parallel to the equatorial line and oriented 27 toward the increasing phi's ; the y-axis is parallel to the meridian 28 line and oriented toward the north pole. 29 30 Internally, a map is first defined within this reference plane and 31 tranported until the point (theta0, phi0) in such a way that both 32 axes are kept parallel to meridian and parallel lines of the sphere. 33 The user can define its own map with axes rotated with respect to 34 reference axes (this rotation is characterized by angle between 35 the local parallel line and the wanted x-axis-- see method 36 SetOrigin(...)) 37 */ 16 38 // 17 39 // la carte est consideree comme un tableau a deux indices i et j, i etant … … 57 79 58 80 /* return/set the number of pixels */ 81 /*! Return number of pixels */ 59 82 virtual int NbPixels() const; 60 83 inline void setNbPixels(int n) {nPix_= n;} 61 84 62 85 /* return the value of pixel number k */ 86 /*! Return value of pixel with index k */ 63 87 virtual T& PixVal(int k); 88 /*! const version of previous method */ 64 89 virtual T const& PixVal(int k) const; 65 90 … … 67 92 virtual bool ContainsSph(double theta, double phi) const; 68 93 /* return the index of pixel at (theta,phi) */ 94 /*! Return index of the pixel with spherical coordinates (theta,phi) */ 69 95 virtual int PixIndexSph(double theta,double phi) const; 70 96 71 97 /* return the spherical coordinates of center of pixel number k */ 98 /*! Return (theta, phi) coordinates of pixel with index k */ 72 99 virtual void PixThetaPhi(int k,double& theta,double& phi) const; 73 100 74 101 /* return the Pixel Solid angle (steradians) */ 102 /*! Pixel Solid angle (steradians) 103 104 All the pixels have not necessarly the same size in (theta, phi) 105 because of the projection scheme which is not yet fixed. 106 */ 75 107 virtual double PixSolAngle(int k) const; 76 108 77 109 // ---------- Specific methods ------------------------------ 78 110 111 /*! Resize storage area for pixels */ 79 112 void ReSize(int nx, int ny); 80 113 … … 82 115 83 116 /* Origin (with angle between x axis and phi axis, in degrees) x0,y0 the default: middle of map*/ 117 /*! set the referential of the map (angles in degrees) 118 119 (default x0=siz_x/2, y0=siz_y/2) 120 */ 84 121 virtual void SetOrigin(double theta=90.,double phi=0.,double angle=0.); 122 /*! set the referential of the map (angles in degrees) */ 85 123 virtual void SetOrigin(double theta,double phi,int x0,int y0,double angle=0.); 86 124 87 125 /* Pixel size (degres) */ 126 /*! angle range of tthe map (angles in degrees) */ 88 127 virtual void SetSize(double angleX,double angleY); 89 128 … … 91 130 inline bool LocalMap_isDone() const {return(originFlag_ && extensFlag_);}; 92 131 93 /* Projection to/fromspherical map */132 /*! Projection to a spherical map */ 94 133 virtual void Project(SphericalMap<T>& sphere) const; 95 134 … … 120 159 121 160 void InitNul(); 161 /*! Return 2 indices corresponding to the pixel number k */ 122 162 void Getij(int k,int& i,int& j) const; 163 /*! Transform a pair of coordinates (theta, phi) given in 164 reference coordinates into map coordinates 165 */ 123 166 void ReferenceToUser(double& theta,double& phi) const; 167 /*! Transform a pair of coordinates (theta, phi) given in 168 map coordinates into reference coordinates 169 */ 124 170 void UserToReference(double& theta,double& phi) const; 171 /*! Given coordinates in pixel units in the REFERENCE PLANE, return 172 (theta, phi) in "absolute" referential theta=pi/2 ,phi=0. 173 */ 125 174 void PixProjToAngle(double x,double y,double& theta,double& phi) const; 175 /*! Given coordinates (theta, phi) in "absolute" referential 176 theta=pi/2 ,phi=0 return pixel indices (i,j) in the REFERENCE PLANE. 177 */ 126 178 void AngleProjToPix(double theta,double phi,double& x,double& y) const; 127 179 … … 148 200 149 201 // ------------- Classe pour la gestion de persistance -- 202 //! Delegated objects for persitance management 150 203 template <class T> 151 204 class FIO_LocalMap : public PPersist … … 161 214 virtual AnyDataObj* DataObj(); 162 215 inline operator LocalMap<T>() { return(*dobj); } 163 inline LocalMap<T> getObj() { return(*dobj); }216 //inline LocalMap<T> getObj() { return(*dobj); } 164 217 165 218 protected :
Note:
See TracChangeset
for help on using the changeset viewer.