Changeset 1217 in Sophya for trunk/SophyaLib/SkyMap/localmap.h
- Timestamp:
- Oct 3, 2000, 10:19:18 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/localmap.h
r1163 r1217 10 10 #include "ppersist.h" 11 11 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 j17 as row index. The map is supposed to lie on a plan tangent to the18 celestial sphere in a point whose coordinates are (x0,y0) on the local19 map and (theta0, phi0) on the sphere. The range of the map is defined20 by two values of angles covered respectively by all the pixels in21 x direction and all the pixels in y direction (SetSize()).22 23 A "reference plane" is considered : this plane is tangent to the24 celestial sphere in a point with angles theta=Pi/2 and phi=0. This25 point is the origine of coordinates is of the reference plane. The26 x-axis is the tangent parallel to the equatorial line and oriented27 toward the increasing phi's ; the y-axis is parallel to the meridian28 line and oriented toward the north pole.29 30 Internally, a map is first defined within this reference plane and31 tranported until the point (theta0, phi0) in such a way that both32 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 to34 reference axes (this rotation is characterized by angle between35 the local parallel line and the wanted x-axis-- see method36 SetOrigin(...))37 */38 //39 // la carte est consideree comme un tableau a deux indices i et j, i etant40 // indice de colonne et j indice de ligne. La carte est supposee resider41 // dans un plan tangent, dont le point de tangence est repere (x0,y0) dans42 // la carte et (theta0, phi0) sur la sphere celeste. L extension de la43 // carte est definie par les valeurs de deux angles couverts respectivement44 // par la totalite des pixels en x de la carte et la totalite des pixels45 // en y. (SetSize()).46 // On considere un "plan de reference" : plan tangent a la sphere celeste47 // aux angles theta=Pi/2 et phi=0. Dans ce plan L origine des coordonnees48 // est le point de tangence. L axe Ox est la tangente parallele a49 // lequateur, dirige vers les phi croissants, l axe Oy est parallele50 // au meridien, dirige vers le pole nord.51 // De maniere interne a la classe une carte est definie dans ce plan de52 // reference et transportee jusqu au point (theta0, phi0) de sorte que les // axes restent paralleles aux meridiens et paralleles. L utilisateur peut53 // definir sa carte selon un repere en rotation par rapport au repere de54 // reference (par l angle entre le parallele et l axe Ox souhaite --55 // methode SetOrigin(...))56 12 57 13 … … 61 17 62 18 namespace SOPHYA { 19 20 21 /* Class LocalMap */ 63 22 64 23 … … 76 35 77 36 inline virtual bool IsTemp(void) const { return pixels_.IsTemp();} 37 78 38 /*! Setting blockdata to temporary (see ndatablock documentation) */ 79 39 inline virtual void SetTemp(bool temp=false) const {pixels_.SetTemp(temp);}; … … 89 49 // ---------- Definition of PixelMap abstract methods ------- 90 50 91 /* return/set the number of pixels */92 /*! Return number of pixels */93 51 virtual int_4 NbPixels() const; // D.Y. int change en int_4 rationalisation Mac 94 52 95 /* return the value of pixel number k */96 /*! Return value of pixel with index k */97 53 virtual T& PixVal(int_4 k); 98 /*! const version of previous method */99 54 virtual T const& PixVal(int_4 k) const; 100 55 101 /* Return true if teta,phi in map */102 56 virtual bool ContainsSph(double theta, double phi) const; 103 /* return the index of pixel at (theta,phi) */104 /*! Return index of the pixel with spherical coordinates (theta,phi) */105 57 virtual int_4 PixIndexSph(double theta,double phi) const; 106 58 107 /* return the spherical coordinates of center of pixel number k */108 /*! Return (theta, phi) coordinates of pixel with index k */109 59 virtual void PixThetaPhi(int_4 k,double& theta,double& phi) const; 110 60 111 /*! Set all pixels to value v */112 61 virtual T SetPixels(T v); 113 62 114 /* return the Pixel Solid angle (steradians) */115 /*! Pixel Solid angle (steradians)116 117 All the pixels have not necessarly the same size in (theta, phi)118 because of the projection scheme which is not yet fixed.119 */120 63 virtual double PixSolAngle(int_4 k) const; 121 64 122 65 // ---------- Specific methods ------------------------------ 123 66 124 /*! Resize storage area for pixels */125 67 void ReSize(int_4 nx, int_4 ny); 126 68 127 69 inline virtual char* TypeOfMap() const {return "LOCAL";}; 128 70 129 /* Origin (with angle between x axis and phi axis, in degrees) x0,y0 the default: middle of map*/130 /*! set the referential of the map (angles in degrees)131 132 (default x0=siz_x/2, y0=siz_y/2)133 */134 71 virtual void SetOrigin(double theta=90.,double phi=0.,double angle=0.); 135 /*! set the referential of the map (angles in degrees) */136 72 virtual void SetOrigin(double theta,double phi,int_4 x0,int_4 y0,double angle=0.); 137 73 138 /* Pixel size (degres) */139 /*! angle range of tthe map (angles in degrees) */140 74 virtual void SetSize(double angleX,double angleY); 141 75 142 /* Check to see if the local mapping is done */76 /*! Check to see if the local mapping is done */ 143 77 inline bool LocalMap_isDone() const {return(originFlag_ && extensFlag_);}; 144 78 145 /*! Projection to a spherical map */146 79 virtual void Project(SphericalMap<T>& sphere) const; 147 80 … … 149 82 -> static method, or separate class */ 150 83 151 /* provides a integer characterizing the pixelization refinement (here : number of pixels) */84 /*! provides a integer characterizing the pixelization refinement (here : number of pixels) */ 152 85 inline virtual int_4 SizeIndex() const {return(nPix_);} 153 86 inline int_4 Size_x() const {return nSzX_;} … … 180 113 181 114 void InitNul(); 182 /*! Return 2 indices corresponding to the pixel number k */183 115 void Getij(int_4 k,int_4& i,int_4& j) const; 184 /*! Transform a pair of coordinates (theta, phi) given in185 reference coordinates into map coordinates186 */187 116 void ReferenceToUser(double& theta,double& phi) const; 188 /*! Transform a pair of coordinates (theta, phi) given in189 map coordinates into reference coordinates190 */191 117 void UserToReference(double& theta,double& phi) const; 192 /*! Given coordinates in pixel units in the REFERENCE PLANE, return193 (theta, phi) in "absolute" referential theta=pi/2 ,phi=0.194 */195 118 void PixProjToAngle(double x,double y,double& theta,double& phi) const; 196 /*! Given coordinates (theta, phi) in "absolute" referential197 theta=pi/2 ,phi=0 return pixel indices (i,j) in the REFERENCE PLANE.198 */199 119 void AngleProjToPix(double theta,double phi,double& x,double& y) const; 200 120
Note:
See TracChangeset
for help on using the changeset viewer.