Changeset 1196 in Sophya
- Timestamp:
- Sep 22, 2000, 12:36:46 PM (25 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/HEALPixUtils.cc
r1195 r1196 13 13 } 14 14 15 namespace SOPHYA 16 { 15 using namespace SOPHYA; 16 17 ////////////////////////////////////////////////////////////////////////// 18 // 19 // ------------- Classe PIXELS_XY ----------------------- 20 // 21 class PIXELS_XY 22 { 23 24 public : 25 26 static PIXELS_XY& instance(); 27 28 NDataBlock<int_4> pix2x_; 29 NDataBlock<int_4> pix2y_; 30 NDataBlock<int_4> x2pix_; 31 NDataBlock<int_4> y2pix_; 32 33 private : 34 35 PIXELS_XY(); 36 void mk_pix2xy(); 37 void mk_xy2pix(); 38 }; 17 39 18 40 … … 38 60 } 39 61 62 // Instance unique de la classe PIXELS_XY 63 static PIXELS_XY * single = NULL; 64 40 65 PIXELS_XY& PIXELS_XY::instance() 41 66 { 42 static PIXELS_XY single;43 return ( single);67 if (single == NULL) single = new PIXELS_XY ; 68 return (*single); 44 69 } 45 70 … … 128 153 129 154 130 int_4 nest2ring(int_4 nside, int_4 ipnest)155 int_4 HEALPix::nest2ring(int_4 nside, int_4 ipnest) 131 156 { 132 157 /* … … 210 235 211 236 212 int_4 ring2nest(int_4 nside, int_4 ipring)237 int_4 HEALPix::ring2nest(int_4 nside, int_4 ipring) 213 238 { 214 239 /* … … 318 343 } 319 344 320 int_4 ang2pix_ring(int_4 nside, double theta, double phi)345 int_4 HEALPix::ang2pix_ring(int_4 nside, double theta, double phi) 321 346 { 322 347 /* … … 393 418 } 394 419 395 int_4 ang2pix_nest(int_4 nside, double theta, double phi)420 int_4 HEALPix::ang2pix_nest(int_4 nside, double theta, double phi) 396 421 { 397 422 /* … … 489 514 } 490 515 491 void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) { 516 void HEALPix::pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) 517 { 492 518 /* 493 519 =================================================== … … 556 582 } 557 583 558 void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) { 584 void HEALPix::pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) 585 { 559 586 /* 560 587 ================================================== … … 644 671 } 645 672 646 } 673 -
trunk/SophyaLib/SkyMap/HEALPixUtils.h
r1195 r1196 9 9 namespace SOPHYA { 10 10 11 ////////////////////////////////////////////////////////////////////////// 12 // 13 // ------------- Classe PIXELS_XY ----------------------- 14 // 15 class PIXELS_XY 16 { 11 // Utility class to compute index to/from angle conversion in HEALPix 12 // spherical map pixelisation 17 13 14 class HEALPix { 18 15 public : 16 static int_4 nest2ring(int_4 nside,int_4 ipnest) ; 17 static int_4 ring2nest(int_4 nside,int_4 ipring) ; 19 18 20 static PIXELS_XY& instance(); 21 22 NDataBlock<int_4> pix2x_; 23 NDataBlock<int_4> pix2y_; 24 NDataBlock<int_4> x2pix_; 25 NDataBlock<int_4> y2pix_; 26 27 private : 28 29 PIXELS_XY(); 30 void mk_pix2xy(); 31 void mk_xy2pix(); 19 static int_4 ang2pix_ring(int_4 nside,double theta,double phi) ; 20 static int_4 ang2pix_nest(int_4 nside,double theta,double phi) ; 21 static void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) ; 22 static void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) ; 32 23 }; 33 34 35 int_4 nest2ring(int_4 nside,int_4 ipnest) ;36 int_4 ring2nest(int_4 nside,int_4 ipring) ;37 38 int_4 ang2pix_ring(int_4 nside,double theta,double phi) ;39 int_4 ang2pix_nest(int_4 nside,double theta,double phi) ;40 void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) ;41 void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) ;42 43 24 44 25 -
trunk/SophyaLib/SkyMap/Makefile
r1118 r1196 3 3 all: $(LIB)libSkyMap.a 4 4 clean: 5 rm -f $(OBJ) fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o5 rm -f $(OBJ)HEALPixUtils.o $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o 6 6 rm -f $(LIB)libSkyMap.a 7 $(LIB)libSkyMap.a : $(OBJ) fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o7 $(LIB)libSkyMap.a : $(OBJ)HEALPixUtils.o $(OBJ)fiolocalmap.o $(OBJ)fiospherehealpix.o $(OBJ)fiospherethetaphi.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mapoperation.o $(OBJ)skymapinit.o $(OBJ)spherehealpix.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o 8 8 $(ARCXX) $(ARCXXFLAGS) $@ $? 9 9 ifeq ($(CXX),cxx) … … 11 11 endif 12 12 13 $(OBJ)HEALPixUtils.o: HEALPixUtils.cc HEALPixUtils.h \ 14 $(INC)machdefs.h \ 15 $(INC)ndatablock.h \ 16 $(INC)anydataobj.h \ 17 $(INC)tvector.h \ 18 $(INC)tmatrix.h \ 19 $(INC)tarray.h \ 20 $(INC)basarr.h \ 21 $(INC)mutyv.h \ 22 $(INC)dvlist.h \ 23 $(INC)objfio.h \ 24 $(INC)ppersist.h \ 25 $(INC)pexceptions.h \ 26 $(INC)gnumd5.h \ 27 $(INC)utilarr.h \ 28 $(INC)smathconst.h 13 29 $(OBJ)fiolocalmap.o: fiolocalmap.cc fiolocalmap.h sphericalmap.h \ 14 30 $(INC)smathconst.h \ … … 133 149 $(INC)basarr.h \ 134 150 $(INC)utilarr.h \ 135 $(INC)strutil.h 151 $(INC)strutil.h HEALPixUtils.h 136 152 $(OBJ)spherepos.o: spherepos.cc spherepos.h \ 137 153 $(INC)machdefs.h \ -
trunk/SophyaLib/SkyMap/healpix.h
r853 r1196 7 7 #include "spherehealpix.h" 8 8 9 #define HEALPix SphereHEALPix10 9 #define SphereGorski SphereHEALPix 11 10 #define SphereHealpix SphereHEALPix -
trunk/SophyaLib/SkyMap/objlist.list
r941 r1196 1 HEALPixUtils.o 1 2 fiolocalmap.o 2 3 fiospherehealpix.o -
trunk/SophyaLib/SkyMap/spherehealpix.cc
r1195 r1196 7 7 #include "spherehealpix.h" 8 8 #include "strutil.h" 9 #include "HEALPixUtils.h" 9 10 10 extern "C" 11 11 { -
trunk/SophyaLib/SkyMap/spherehealpix.h
r1195 r1196 9 9 #include "ppersist.h" 10 10 11 #include "HEALPixUtils.h" 11 12 12 13 namespace SOPHYA { … … 63 64 class SphereHEALPix : public SphericalMap<T> 64 65 { 65 66 67 friend class FIO_SphereHEALPix<T>;68 friend class FITS_SphereHEALPix<T>;69 70 66 public : 67 // Static Methods to ease the use of HEALPix index <> angle conversion methods 68 69 static inline int_4 nest2ring(int_4 nside,int_4 ipnest) 70 { return HEALPix::nest2ring(nside, ipnest); } 71 static inline int_4 ring2nest(int_4 nside,int_4 ipring) 72 { return HEALPix::ring2nest(nside, ipring); } 73 static inline int_4 ang2pix_ring(int_4 nside,double theta,double phi) 74 { return HEALPix::ang2pix_ring(nside, theta, phi); } 75 static inline int_4 ang2pix_nest(int_4 nside,double theta,double phi) 76 { return HEALPix::ang2pix_nest(nside, theta, phi); } 77 static inline void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) 78 { HEALPix::pix2ang_ring(nside, ipix, theta, phi); } 79 static inline void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) 80 { HEALPix::pix2ang_nest(nside, ipix, theta, phi); } 71 81 72 82 SphereHEALPix(); … … 217 227 {return Set(a);} 218 228 229 void CloneOrShare(const SphereHEALPix<T>& a); 230 SphereHEALPix<T>& Set(const SphereHEALPix<T>& a); 231 SphereHEALPix<T>& CopyElt(const SphereHEALPix<T>& a); 232 233 234 // friend declaration for classes which handle persistence and FITS IO 235 friend class FIO_SphereHEALPix<T>; 236 friend class FITS_SphereHEALPix<T>; 219 237 220 pr ivate:238 protected : 221 239 222 240 // ------------- méthodes internes ---------------------- … … 224 242 void SetThetaSlices(); 225 243 226 //int_4 nest2ring(int_4 nside,int_4 ipnest) const;227 //int_4 ring2nest(int_4 nside,int_4 ipring) const;228 229 //int_4 ang2pix_ring(int_4 nside,double theta,double phi) const;230 //int_4 ang2pix_nest(int_4 nside,double theta,double phi) const;231 //void pix2ang_ring(int_4 nside,int_4 ipix,double& theta,double& phi) const;232 //void pix2ang_nest(int_4 nside,int_4 ipix,double& theta,double& phi) const;233 244 inline void setParameters(int_4 nside, int_4 nbpixels, double solangle) 234 245 { … … 238 249 } 239 250 240 void CloneOrShare(const SphereHEALPix<T>& a);241 SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);242 SphereHEALPix<T>& CopyElt(const SphereHEALPix<T>& a);243 244 251 // ------------- variables internes ----------------------- 245 252 -
trunk/SophyaLib/SkyMap/spherethetaphi.h
r980 r1196 34 34 class SphereThetaPhi : public SphericalMap<T> 35 35 { 36 37 friend class FIO_SphereThetaPhi<T>;38 friend class FITS_SphereThetaPhi<T>;39 36 40 37 public : … … 185 182 void print(ostream& os) const; 186 183 187 inline SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 184 void CloneOrShare(const SphereThetaPhi<T>& a); 185 186 SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a); 187 SphereThetaPhi<T>& CopyElt(const SphereThetaPhi<T>& a); 188 189 inline SphereThetaPhi<T>& operator = (const SphereThetaPhi<T>& a) 188 190 {return Set(a);} 189 191 190 191 private : 192 // friend declaration for classes which handle persistence and FITS IO 193 friend class FIO_SphereThetaPhi<T>; 194 friend class FITS_SphereThetaPhi<T>; 195 196 protected : 192 197 193 198 // ------------- méthodes internes ---------------------- … … 199 204 NTheta_= nbThetaIndex; 200 205 } 201 void CloneOrShare(const SphereThetaPhi<T>& a);202 203 SphereThetaPhi<T>& Set(const SphereThetaPhi<T>& a);204 SphereThetaPhi<T>& CopyElt(const SphereThetaPhi<T>& a);205 206 206 207 // ------------- variables internes ---------------------
Note:
See TracChangeset
for help on using the changeset viewer.