Changeset 980 in Sophya for trunk/SophyaLib/SkyMap/spherethetaphi.cc
- Timestamp:
- Apr 28, 2000, 4:12:44 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r908 r980 39 39 template <class T> 40 40 SphereThetaPhi<T>::SphereThetaPhi() 41 : NPhi_(), TNphi_(), Theta_(), pixels_() 41 42 42 43 //-- 43 44 { 44 45 InitNul(); 45 pixels_.Reset();46 46 } 47 47 … … 67 67 pixels_(s.pixels_ , share) 68 68 { 69 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);70 69 71 70 NTheta_= s.NTheta_; 72 71 NPix_ = s.NPix_; 73 72 Omega_ = s.Omega_; 73 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_); 74 74 } 75 75 … … 78 78 : NPhi_(s.NPhi_), TNphi_(s.TNphi_), Theta_(s.Theta_), pixels_(s.pixels_) 79 79 { 80 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);81 80 82 81 NTheta_= s.NTheta_; 83 82 NPix_ = s.NPix_; 84 83 Omega_ = s.Omega_; 84 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_); 85 85 } 86 86 … … 122 122 { 123 123 124 NPhi_.CloneOrShare(a.NPhi_); 125 TNphi_.CloneOrShare(a.TNphi_); 126 Theta_.CloneOrShare(a.Theta_); 127 pixels_.CloneOrShare(a.pixels_); 128 } 129 124 NTheta_= a.NTheta_; 125 NPix_ = a.NPix_; 126 Omega_ = a.Omega_; 127 NPhi_.CloneOrShare(a.NPhi_); 128 TNphi_.CloneOrShare(a.TNphi_); 129 Theta_.CloneOrShare(a.Theta_); 130 pixels_.CloneOrShare(a.pixels_); 131 } 132 133 ////////////////////////// methodes de copie/share 130 134 template<class T> 131 135 SphereThetaPhi<T>& SphereThetaPhi<T>::Set(const SphereThetaPhi<T>& a) 132 136 { 133 137 if (this != &a) 134 138 { 135 136 137 NTheta_= a.NTheta_;138 NPix_ = a.NPix_;139 Omega_ = a.Omega_;140 CloneOrShare(a);139 140 141 if (a.NbPixels() < 1) 142 throw RangeCheckError("SphereThetaPhi<T>::Set(a ) - Array a not allocated ! "); 143 if (NbPixels() < 1) CloneOrShare(a); 144 else CopyElt(a); 141 145 if (mInfo_) delete mInfo_; 142 146 mInfo_ = NULL; … … 144 148 } 145 149 return(*this); 146 } 147 148 150 } 151 152 template<class T> 153 SphereThetaPhi<T>& SphereThetaPhi<T>::CopyElt(const SphereThetaPhi<T>& a) 154 { 155 if (NbPixels() < 1) 156 throw RangeCheckError("SphereThetaPhi<T>::CopyElt(const SphereThetaPhi<T>& ) - Not Allocated Array ! "); 157 if (NbPixels() != a.NbPixels()) 158 throw(SzMismatchError("SphereThetaPhi<T>::CopyElt(const SphereThetaPhi<T>&) SizeMismatch")) ; 159 160 NTheta_= a.NTheta_; 161 NPix_ = a.NPix_; 162 Omega_ = a.Omega_; 163 int k; 164 for (k=0; k< NPix_; k++) pixels_(k) = a.pixels_(k); 165 for (k=0; k< a.NPhi_.Size(); k++) NPhi_(k) = a.NPhi_(k); 166 for (k=0; k< a.TNphi_.Size(); k++) TNphi_(k) = a.TNphi_(k); 167 for (k=0; k< a.Theta_.Size(); k++) Theta_(k) = a.Theta_(k); 168 return(*this); 169 170 } 149 171 150 172 /* --Methode-- */ … … 524 546 // Le nombre de pixels en phi de chacune des bandes en theta 525 547 // NPhi_ = new int_4[m]; 526 NPhi_.ReSize(m); 548 // une taille de m suffit, mais je mets m+1 pour que les 3 tableaux aient 549 // la meme taille pour une manipulation plus faciles par la librairie 550 // cfitsio -- GLM (13-04-00) 551 NPhi_.ReSize(m+1); 527 552 528 553 // Le nombre/Deuxpi total des pixels contenus dans les bandes de z superieur a une
Note:
See TracChangeset
for help on using the changeset viewer.