Changeset 518 in Sophya
- Timestamp:
- Oct 26, 1999, 4:31:44 PM (26 years ago)
- Location:
- trunk/SophyaLib/Samba
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/Makefile
r510 r518 3 3 all: $(LIB)libSamba.a 4 4 clean: 5 rm -f $(OBJ)ana gen.o $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)lambuilder.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherethetaphi.o $(OBJ)syngen.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o6 rm $(LIB)libSamba.a7 $(LIB)libSamba.a : $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)s can.o $(OBJ)spheregorski.o $(OBJ)spherethetaphi.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o5 rm -f $(OBJ)ana2fast.o $(OBJ)anagen.o $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)lambuilder.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)sambainit.o $(OBJ)scan.o $(OBJ)spheregorski.o $(OBJ)spherepos.o $(OBJ)spherethetaphi.o $(OBJ)syn2fast.o $(OBJ)syngen.o $(OBJ)unitvector.o $(OBJ)utilgeom.o $(OBJ)vector3d.o 6 rm -f $(LIB)libSamba.a 7 $(LIB)libSamba.a : $(OBJ)bruit.o $(OBJ)circle.o $(OBJ)gorfph.o $(OBJ)localmap.o $(OBJ)longlat.o $(OBJ)mlobe.o $(OBJ)sambainit.o $(OBJ)scan.o $(OBJ)spheregorski.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)anagen.o: anagen.cc anagen.h $(INC)cvector.h \14 $(INC)matrix.h \15 $(INC)peida.h \16 $(INC)machdefs.h \17 $(INC)pclassids.h \18 $(INC)utils.h \19 $(INC)perrors.h \20 $(INC)pexceptions.h \21 $(INC)fmath.h \22 $(INC)ppersist.h \23 $(INC)md5.h sphericalmap.h \24 $(INC)nbmath.h pixelmap.h \25 $(INC)dvlist.h \26 $(INC)objfio.h \27 $(INC)anydataobj.h \28 $(INC)tvector.h \29 $(INC)tmatrix.h \30 $(INC)ndatablock.h lambuilder.h \31 $(INC)fftserver.h32 13 $(OBJ)bruit.o: bruit.cc $(INC)fmath.h bruit.h \ 33 14 $(INC)nbrandom.h \ … … 66 47 $(INC)ndatablock.h unitvector.h vector3d.h \ 67 48 longlat.h utilgeom.h $(INC)timing.h 49 $(OBJ)sambainit.o: sambainit.cc sambainit.h \ 50 $(INC)outilsinit.h \ 51 $(INC)peidainit.h \ 52 $(INC)machdefs.h \ 53 $(INC)pclassids.h 68 54 $(OBJ)scan.o: scan.cc $(INC)machdefs.h \ 69 55 $(INC)pclassids.h scan.h \ … … 90 76 $(INC)strutil.h \ 91 77 $(INC)piocmplx.h 78 $(OBJ)spherepos.o: spherepos.cc spherepos.h \ 79 $(INC)machdefs.h \ 80 $(INC)pclassids.h \ 81 $(INC)ppersist.h \ 82 $(INC)pexceptions.h \ 83 $(INC)md5.h unitvector.h vector3d.h \ 84 longlat.h utilgeom.h 92 85 $(OBJ)spherethetaphi.o: spherethetaphi.cc spherethetaphi.h sphericalmap.h \ 93 86 $(INC)nbmath.h \ … … 104 97 $(INC)ndatablock.h \ 105 98 $(INC)piocmplx.h 106 $(OBJ)syngen.o: syngen.cc syngen.h $(INC)cvector.h \107 $(INC)matrix.h \108 $(INC)peida.h \109 $(INC)machdefs.h \110 $(INC)pclassids.h \111 $(INC)utils.h \112 $(INC)perrors.h \113 $(INC)pexceptions.h \114 $(INC)fmath.h \115 $(INC)ppersist.h \116 $(INC)md5.h sphericalmap.h \117 $(INC)nbmath.h pixelmap.h \118 $(INC)dvlist.h \119 $(INC)objfio.h \120 $(INC)anydataobj.h \121 $(INC)tvector.h \122 $(INC)tmatrix.h \123 $(INC)ndatablock.h lambuilder.h \124 $(INC)fftserver.h125 99 $(OBJ)unitvector.o: unitvector.cc unitvector.h vector3d.h longlat.h \ 126 100 utilgeom.h -
trunk/SophyaLib/Samba/Samba.o.list
r262 r518 5 5 longlat.o 6 6 mlobe.o 7 sambainit.o 7 8 scan.o 8 9 spheregorski.o 10 spherepos.o 9 11 spherethetaphi.o 10 12 unitvector.o -
trunk/SophyaLib/Samba/exclude
r470 r518 1 1 lambuilder.cc 2 ana2fast.cc 3 anagen.cc 4 syngen.cc 5 syn2fast.cc -
trunk/SophyaLib/Samba/lambuilder.cc
r461 r518 2 2 #include "lambuilder.h" 3 3 #include <iostream.h> 4 5 double Lambda2Builder::bignorm = 1.e268; // = 1e-20*1.d288 4 6 5 7 Lambda2Builder::Lambda2Builder(){} -
trunk/SophyaLib/Samba/lambuilder.h
r461 r518 36 36 double fm2_; 37 37 // static const double bignorm=1e-20*HUGE_VAL; 38 static const double bignorm=1e-20*1.d288; 38 // static const double bignorm=1e-20*1.d288; 39 static const double bignorm; 39 40 }; 40 41 -
trunk/SophyaLib/Samba/localmap.cc
r473 r518 220 220 //++ 221 221 template<class T> 222 bool LocalMap<T>::ContainsSph(double theta, double phi) const 223 //-- 224 { 225 return(true); // $CHECK$ A MODIFIER - Reza 26/10/99 226 } 227 228 //++ 229 template<class T> 222 230 int LocalMap<T>::PixIndexSph(double theta,double phi) const 223 231 // … … 591 599 } 592 600 601 // Let's Read the SphereCoordSys object -- ATTENTIOn - $CHECK$ 602 SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject()); 603 dobj->SetCoordSys(cs); 604 593 605 // Pour savoir s'il y avait un DVList Info associe 594 606 char strg[256]; … … 651 663 } 652 664 665 // Let's write the SphereCoordSys object 666 dobj->GetCoordSys()->Write(os); 667 653 668 char strg[256]; 654 669 int nSzX= dobj->Size_x(); -
trunk/SophyaLib/Samba/localmap.h
r473 r518 1 // This may look like C code, but it is really -*- C++ -*- 1 2 #ifndef LOCALMAP_SEEN 2 3 #define LOCALMAP_SEEN … … 63 64 virtual T const& PixVal(int k) const; 64 65 66 /* Return true if teta,phi in map */ 67 virtual bool ContainsSph(double theta, double phi) const; 65 68 /* return the index of pixel at (theta,phi) */ 66 69 virtual int PixIndexSph(double theta,double phi) const; -
trunk/SophyaLib/Samba/pixelmap.h
r473 r518 1 // This may look like C code, but it is really -*- C++ -*- 1 2 #ifndef PIXELMAP_SEEN 2 3 #define PIXELMAP_SEEN … … 4 5 #include "ppersist.h" 5 6 #include "dvlist.h" 7 #include "spherepos.h" 6 8 #include <iostream.h> 7 9 … … 21 23 public: 22 24 23 PixelMap():mInfo_(NULL) {}; 24 virtual ~PixelMap() {}; 25 25 PixelMap(SphereCoordSys* cs = NULL) : mInfo_(NULL) 26 { if (cs) cs_ = cs; else cs = new SphereCoordSys; } 27 virtual ~PixelMap() 28 { if (mInfo_) delete mInfo_; if (cs_) delete cs_; } 29 30 // Set/Change/Get the coordinate system 31 virtual void SetCoordSys(SphereCoordSys* cs) 32 { if (cs) { delete cs_; cs_ = cs; } } 33 inline SphereCoordSys* GetCoordSys() const { return(cs_); } 34 26 35 // Number of pixels 27 36 virtual int NbPixels() const=0; … … 30 39 virtual T& PixVal(int k)=0; 31 40 virtual T const& PixVal(int k) const=0; 32 41 42 // Map s coverage 43 virtual bool ContainsSph(double theta, double phi) const=0; 44 virtual bool Contains(const SpherePosition& spos) const; 45 33 46 // Index of pixel at (theta,phi) 34 47 virtual int PixIndexSph(double theta, double phi) const=0; 48 // Index of pixel at a sky-position 49 virtual int PixIndex(const SpherePosition& spos); 50 35 51 36 52 // Value of pixel number at (theta,phi) … … 55 71 inline T const& operator()(int k) const {return(PixVal(k));} 56 72 73 // Overloading of () to access pixel at a sky position . 74 inline T& operator()(const SpherePosition& spos) 75 { return(PixVal(PixIndex(spos))); } 76 inline T const& operator()(const SpherePosition& spos) const 77 { return(PixVal(PixIndex(spos))); } 78 79 57 80 // Note : no overloading of (double,double) to access pixel (theta,phi). 58 81 // overloading of (double,double) in SphericalMap … … 75 98 76 99 protected : 77 100 SphereCoordSys *cs_; // Coordinate system used in the map 78 101 DVList* mInfo_; // Infos (variables) attachees 79 102 }; 103 104 105 template <class T> 106 int PixelMap<T>::PixIndex(const SpherePosition& spos) 107 { 108 UnitVector v = spos.Transform(*cs_); 109 return(PixIndexSph(v.Theta(), v.Phi())); 110 } 111 112 template <class T> 113 bool PixelMap<T>::Contains(const SpherePosition& spos) const 114 { 115 UnitVector v = spos.Transform(*cs_); 116 return(ContainsSph(v.Theta(), v.Phi())); 117 } 118 80 119 #endif -
trunk/SophyaLib/Samba/spheregorski.cc
r515 r518 452 452 //++ 453 453 template<class T> 454 bool SphereGorski<T>::ContainsSph(double theta, double phi) const 455 //-- 456 { 457 return(true); 458 } 459 460 /* --Methode-- */ 461 //++ 462 template<class T> 454 463 int SphereGorski<T>::PixIndexSph(double theta,double phi) const 455 464 … … 890 899 // return ( ipf + face_num*pow(nside,2));// ! in {0, 12*nside**2 - 1} 891 900 // $CHECK$ Reza 25/10/99 , pow remplace par * 892 // ipf = ipf / ((ns_max/nside)*(ns_max/nside)); // ! in {0, nside**2 - 1}893 // return ( ipf + face_num*(nside*nside);// ! in {0, 12*nside**2 - 1}901 ipf = ipf / ((ns_max/nside)*(ns_max/nside)); 902 return (ipf + face_num*nside*nside); 894 903 } 895 904 … … 1138 1147 } 1139 1148 1149 // Let's Read the SphereCoordSys object -- ATTENTIOn - $CHECK$ 1150 SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject()); 1151 dobj->SetCoordSys(cs); 1152 1140 1153 // Pour savoir s'il y avait un DVList Info associe 1141 1154 char strg[256]; … … 1177 1190 return; 1178 1191 } 1192 1193 // Let's write the SphereCoordSys object 1194 dobj->GetCoordSys()->Write(os); 1179 1195 1180 1196 char strg[256]; -
trunk/SophyaLib/Samba/spheregorski.h
r487 r518 37 37 void GetThetaSlice(int index,double& theta,TVector<double>& phi,TVector<T>& value) const; 38 38 39 /* Return true if teta,phi in map */ 40 virtual bool ContainsSph(double theta, double phi) const; 39 41 /* Indice "RING" du pixel vers lequel pointe une direction definie par 40 42 ses coordonnees spheriques */ -
trunk/SophyaLib/Samba/spherethetaphi.cc
r515 r518 183 183 //++ 184 184 template <class T> 185 bool SphereThetaPhi<T>::ContainsSph(double theta, double phi) const 186 //-- 187 { 188 return(true); 189 } 190 191 /* --Methode-- */ 192 //++ 193 template <class T> 185 194 int SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const 186 195 … … 713 722 } 714 723 724 // Let's Read the SphereCoordSys object -- ATTENTIOn - $CHECK$ 725 SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject()); 726 dobj->SetCoordSys(cs); 727 715 728 // Pour savoir s'il y avait un DVList Info associe 716 729 char strg[256]; … … 767 780 } 768 781 782 // Let's write the SphereCoordSys object 783 dobj->GetCoordSys()->Write(os); 784 769 785 char strg[256]; 770 786 int mNTheta= dobj->SizeIndex(); -
trunk/SophyaLib/Samba/spherethetaphi.h
r487 r518 32 32 virtual T const& PixVal(int k) const; 33 33 34 /* Return true if teta,phi in map */ 35 virtual bool ContainsSph(double theta, double phi) const; 34 36 /* retourne l'indice du pixel a (theta,phi) */ 35 37 virtual int PixIndexSph(double theta, double phi) const; -
trunk/SophyaLib/Samba/unitvector.h
r262 r518 17 17 UnitVector(const Vector3d&); 18 18 19 Vector3d& operator=(const Vector3d&); 20 Vector3d& operator+=(const Vector3d&); 21 Vector3d& operator-=(const Vector3d&); 22 Vector3d operator+(const Vector3d&) const; 23 Vector3d operator-(const Vector3d&) const; 19 virtual Vector3d& operator=(const Vector3d&); 20 virtual Vector3d& operator+=(const Vector3d&); 21 virtual Vector3d& operator-=(const Vector3d&); 22 virtual Vector3d operator+(const Vector3d&) const; 23 virtual Vector3d operator-(const Vector3d&) const; 24 25 virtual Vector3d& operator+=(double d) { return Vector3d::operator+= (d); } 26 virtual Vector3d operator+(double d) const { return Vector3d::operator+ (d); } 27 virtual Vector3d operator-(double d) const { return Vector3d::operator- (d); } 24 28 25 29 void Print(ostream& os) const; -
trunk/SophyaLib/Samba/vector3d.h
r517 r518 31 31 Vector3d(const Vector3d&); 32 32 33 void Setxyz(double x, double y, double z); 34 void SetThetaPhi(double theta, double phi); 35 void ThetaPhi2xyz(); 36 void xyz2ThetaPhi(); 37 double Theta() const {return _theta;} 38 double Phi() const {return _phi;} 39 double X() const {return _x;} 40 double Y() const {return _y;} 41 double Z() const {return _z;} 33 // To manipulate the vector 34 virtual void Setxyz(double x, double y, double z); 35 virtual void SetThetaPhi(double theta, double phi); 36 virtual void ThetaPhi2xyz(); 37 virtual void xyz2ThetaPhi(); 42 38 43 Vector3d& Normalize(); 44 double Norm() const; 39 // Acces to coordinates 40 inline double Theta() const {return _theta;} 41 inline double Phi() const {return _phi;} 42 inline double X() const {return _x;} 43 inline double Y() const {return _y;} 44 inline double Z() const {return _z;} 45 46 virtual Vector3d& Normalize(); 47 virtual double Norm() const; 45 48 46 49 // produit scalaire 47 double Psc(const Vector3d&) const;50 virtual double Psc(const Vector3d&) const; 48 51 49 52 // ecart angulaire entre 2 vecteurs dans [0,Pi] 50 double SepAngle(const Vector3d&) const;53 virtual double SepAngle(const Vector3d&) const; 51 54 52 55 // produit vectoriel 53 Vector3d Vect(const Vector3d&) const;56 virtual Vector3d Vect(const Vector3d&) const; 54 57 55 58 // vecteur perpendiculaire de meme phi 56 Vector3d VperpPhi() const;59 virtual Vector3d VperpPhi() const; 57 60 58 61 // vecteur perpendiculaire de meme theta 59 Vector3d VperpTheta() const;62 virtual Vector3d VperpTheta() const; 60 63 61 Vector3d ETheta() const;62 Vector3d EPhi() const;64 virtual Vector3d ETheta() const; 65 virtual Vector3d EPhi() const; 63 66 64 // rotations d 'Euler65 Vector3d Euler(double, double, double) const;67 // rotations d Euler 68 virtual Vector3d Euler(double, double, double) const; 66 69 67 70 // rotation inverse 68 71 Vector3d InvEuler(double, double, double) const; 69 72 70 // rotation d 'angle phi autour d'un axe omega (regle du tire-bouchon)73 // rotation d angle phi autour d'un axe omega (regle du tire-bouchon) 71 74 Vector3d Rotate(const Vector3d& omega,double phi); 72 75 … … 77 80 virtual Vector3d operator-(const Vector3d&) const; 78 81 79 Vector3d& operator+=(double);80 Vector3d& operator/=(double);81 Vector3d& operator*=(double);82 virtual Vector3d& operator+=(double); 83 virtual Vector3d& operator/=(double); 84 virtual Vector3d& operator*=(double); 82 85 83 Vector3d operator+(double) const; 84 Vector3d operator-(double) const; 85 Vector3d operator*(double) const; 86 Vector3d operator/(double) const; 87 Vector3d operator^(const Vector3d&) const; // produit vectoriel 88 double operator*(const Vector3d&) const; // produit scalaire 86 virtual Vector3d operator+(double) const; 87 virtual Vector3d operator-(double) const; 88 virtual Vector3d operator*(double) const; 89 virtual Vector3d operator/(double) const; 90 91 virtual Vector3d operator^(const Vector3d&) const; // produit vectoriel 92 virtual double operator*(const Vector3d&) const; // produit scalaire 93 89 94 bool operator==(const Vector3d&); 90 95
Note:
See TracChangeset
for help on using the changeset viewer.