source: Sophya/trunk/SophyaLib/Samba/spherethetaphi.cc@ 699

Last change on this file since 699 was 699, checked in by ansari, 26 years ago

suppression d'impression inutile

File size: 18.8 KB
Line 
1#include "spherethetaphi.h"
2#include "nbmath.h"
3#include <complex>
4#include "piocmplx.h"
5#include <iostream.h>
6
7
8//***************************************************************
9//++
10// Class SphereThetaPhi
11//
12//
13// include spherethetaphi.h nbmath.h
14//
15// sphere splitted with respect to theta, phi : each hemisphere is
16// splitted into (m-1) parallels (equator does not enter into account).
17// This operation defines m slices, each of which is splitted into
18// equidistant meridians. This splitting is realized in such a way that
19// all pixels have the same area and are as square as possible.
20
21// One begins with the hemisphere with positive z, starting from the pole
22// toward the equator. The first pixel is the polar cap ; it is circular
23// and centered on theta=0.
24//--
25//++
26//
27// Links Parents
28//
29// SphericalMap
30//--
31
32/* --Methode-- */
33//++
34// Titre Constructors
35//--
36//++
37
38template <class T>
39SphereThetaPhi<T>::SphereThetaPhi()
40
41//--
42{
43 InitNul();
44 pixels_.Reset();
45}
46
47
48/* --Methode-- */
49
50//++
51template <class T>
52SphereThetaPhi<T>::SphereThetaPhi(int_4 m)
53
54// m is the number of slices in theta on an hemisphere (the polar cap
55// forms the first slice).
56// pet is a dummy parameter at the moment.
57//--
58{
59 InitNul();
60 Pixelize(m);
61}
62
63template <class T>
64SphereThetaPhi<T>::SphereThetaPhi(const SphereThetaPhi<T>& s, bool share)
65 : pixels_(s.pixels_ , share)
66{
67 if(s.mInfo_) mInfo_= new DVList(*s.mInfo_);
68 NTheta_= s.NTheta_;
69 NPix_ = s.NPix_;
70 NPhi_ = new int_4[NTheta_];
71 Theta_ = new double[NTheta_+1];
72 TNphi_ = new int_4[NTheta_+1];
73 for(int k = 0; k < NTheta_; k++)
74 {
75 NPhi_[k] = s.NPhi_[k];
76 Theta_[k]= s.Theta_[k];
77 TNphi_[k]= s.TNphi_[k];
78 }
79 Theta_[NTheta_]= s.Theta_[NTheta_];
80 TNphi_[NTheta_]= s.TNphi_[NTheta_];
81 Omega_ = s.Omega_;
82}
83
84//++
85// Titre Destructor
86//--
87//++
88template <class T>
89SphereThetaPhi<T>::~SphereThetaPhi()
90
91//--
92{
93 Clear();
94}
95
96//++
97// Titre Public Méthods
98//--
99template <class T>
100void SphereThetaPhi<T>::InitNul()
101//
102// initialise à zéro les variables de classe pointeurs
103{
104 NTheta_= 0;
105 NPix_ = 0;
106 Theta_ = NULL;
107 NPhi_ = NULL;
108 TNphi_ = NULL;
109// pixels_.Reset(); Pas de reset par InitNul (en cas de share) - Reza 20/11/99 $CHECK$
110}
111
112/* --Methode-- */
113template <class T>
114void SphereThetaPhi<T>::Clear()
115
116{
117 if(Theta_) delete[] Theta_;
118 if(NPhi_ ) delete[] NPhi_;
119 if(TNphi_) delete[] TNphi_;
120 InitNul();
121}
122
123//++
124template <class T>
125void SphereThetaPhi<T>::Resize(int_4 m)
126// re-pixelize the sphere
127//--
128{
129 Clear();
130 Pixelize(m);
131}
132
133/* --Methode-- */
134//++
135template <class T>
136int_4 SphereThetaPhi<T>::NbPixels() const
137
138// Return total number of pixels
139//--
140{
141 return(NPix_);
142}
143
144/* --Methode-- */
145//++
146template <class T>
147T& SphereThetaPhi<T>::PixVal(int_4 k)
148
149// Return value of pixel with index k
150//--
151{
152 if((k < 0) || (k >= NPix_))
153 {
154 //THROW(out_of_range("SphereThetaPhi::PIxVal Pixel index out of range"));
155 cout << " SphereThetaPhi::PIxVal : exceptions a mettre en place" <<endl;
156 THROW(rangeCheckErr);
157 }
158 return pixels_(k);
159}
160
161//++
162template <class T>
163T const& SphereThetaPhi<T>::PixVal(int_4 k) const
164
165// Return value of pixel with index k
166//--
167{
168 if((k < 0) || (k >= NPix_))
169 {
170 cout << " SphereThetaPhi::PIxVal : exceptions a mettre en place" <<endl;
171 //THROW(out_of_range("SphereThetaPhi::PIxVal Pixel index out of range"));
172 throw "SphereThetaPhi::PIxVal Pixel index out of range";
173 }
174 return *(pixels_.Data()+k);
175}
176
177/* --Methode-- */
178//++
179template <class T>
180bool SphereThetaPhi<T>::ContainsSph(double /*theta*/, double /*phi*/) const
181//--
182{
183 return(true);
184}
185
186/* --Methode-- */
187//++
188template <class T>
189int_4 SphereThetaPhi<T>::PixIndexSph(double theta, double phi) const
190
191// Return index of the pixel corresponding to
192// direction (theta, phi).
193//--
194{
195 double dphi;
196 int i,k;
197 bool fgzn = false;
198
199 if((theta > Pi) || (theta < 0.)) return(-1);
200 if((phi < 0.) || (phi > DeuxPi)) return(-1);
201 if(theta > Pi*0.5) {fgzn = true; theta = Pi-theta;}
202
203 // La bande d'indice kt est limitée par les valeurs de theta contenues dans
204 // Theta_[kt] et Theta_[kt+1]
205 for( i=1; i< NTheta_; i++ )
206 if( theta < Theta_[i] ) break;
207
208 dphi= DeuxPi/(double)NPhi_[i-1];
209
210 if (fgzn) k= NPix_-TNphi_[i]+(int_4)(phi/dphi);
211 else k= TNphi_[i-1]+(int_4)(phi/dphi);
212 return(k);
213}
214
215/* --Methode-- */
216//++
217template <class T>
218void SphereThetaPhi<T>::PixThetaPhi(int_4 k,double& theta,double& phi) const
219
220// Return (theta,phi) coordinates of middle of pixel with index k
221//--
222{
223 int i;
224 bool fgzn = false;
225
226 if((k < 0) || (k >= NPix_)) {theta = -99999.; phi = -99999.; return; }
227 if( k >= NPix_/2) {fgzn = true; k = NPix_-1-k;}
228
229 // recupère l'indice i de la tranche qui contient le pixel k
230 for( i=0; i< NTheta_; i++ )
231 if( k < TNphi_[i+1] ) break;
232
233 // angle theta
234 theta= 0.5*(Theta_[i]+Theta_[i+1]);
235 if (fgzn) theta= Pi-theta;
236
237 // angle phi
238 k -= TNphi_[i];
239 phi= DeuxPi/(double)NPhi_[i]*(double)(k+.5);
240 if (fgzn) phi= DeuxPi-phi;
241}
242
243template <class T>
244T SphereThetaPhi<T>::SetPixels(T v)
245{
246pixels_.Reset(v);
247return(v);
248}
249
250//++
251template <class T>
252double SphereThetaPhi<T>::PixSolAngle(int_4 /*dummy*/) const
253
254// Pixel Solid angle (steradians)
255// All the pixels have the same solid angle. The dummy argument is
256// for compatibility with eventual pixelizations which would not
257// fulfil this requirement.
258//--
259{
260 return Omega_;
261}
262
263/* --Methode-- */
264//++
265template <class T>
266void SphereThetaPhi<T>::Limits(int_4 k,double& tetMin,double& tetMax,double& phiMin,double& phiMax)
267
268// Return values of theta,phi which limit the pixel with index k
269//--
270 {
271 int j;
272 double dphi;
273 bool fgzn= false;
274
275 if((k < 0) || (k >= NPix_)) {
276 tetMin= -99999.;
277 phiMin= -99999.;
278 tetMax= -99999.;
279 phiMax= -99999.;
280 return;
281 }
282
283 // si on se trouve dans l'hémisphère Sud
284 if(k >= NPix_/2) {
285 fgzn= true;
286 k= NPix_-1-k;
287 }
288
289 // on recupere l'indice i de la tranche qui contient le pixel k
290 int i;
291 for( i=0; i< NTheta_; i++ )
292 if(k < TNphi_[i+1]) break;
293
294 // valeurs limites de theta dans l'hemisphere Nord
295 tetMin= Theta_[i];
296 tetMax= Theta_[i+1];
297 // valeurs limites de theta dans l'hemisphere Sud
298 if (fgzn) {
299 tetMin= Pi-Theta_[i+1];
300 tetMax= Pi-Theta_[i];
301 }
302
303 // pixel correspondant dans l'hemisphere Nord
304 if (fgzn) k= TNphi_[i+1]-k+TNphi_[i]-1;
305
306 // indice j de discretisation ( phi= j*dphi )
307 j= k-TNphi_[i];
308 dphi= DeuxPi/(double)NPhi_[i];
309
310 // valeurs limites de phi
311 phiMin= dphi*(double)(j);
312 phiMax= dphi*(double)(j+1);
313 return;
314}
315
316/* --Methode-- */
317//++
318template <class T>
319int_4 SphereThetaPhi<T>::NbThetaSlices() const
320
321// Return number of theta-slices on the sphere
322//--
323{
324 int nbslices;
325 nbslices= 2*NTheta_;
326 return(nbslices);
327}
328
329/* --Methode-- */
330//++
331template <class T>
332int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const
333
334// Return number of pixels in phi-direction of the kt-th slice
335//--
336{
337 int nbpix;
338 // verification
339 if((kt < 0) || (kt >= 2*NTheta_)) return(-1);
340
341 // si on se trouve dans l'hemisphere Sud
342 if(kt >= NTheta_) {
343 kt= 2*NTheta_-1-kt;
344 }
345
346 // nombre de pixels
347 nbpix= NPhi_[kt];
348 return(nbpix);
349}
350
351
352/* --Methode-- */
353//++
354template <class T>
355void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax)
356
357// Return theta values which limit the slice kt
358//--
359{
360 bool fgzn= false;
361 // verification
362 if( (kt< 0) || (kt>= 2*NTheta_) ) {
363 tetMin= -99999.;
364 tetMax= -99999.;
365 return;
366 }
367
368 // si on se trouve dans l'hemisphere Sud
369 if( kt >= NTheta_ ) {
370 fgzn= true;
371 kt= 2*NTheta_-1-kt;
372 }
373
374 // valeurs limites de theta dans l'hemisphere Nord
375 tetMin= Theta_[kt];
376 tetMax= Theta_[kt+1];
377 // valeurs limites de theta dans l'hemisphere Sud
378 if (fgzn) {
379 tetMin= Pi-Theta_[kt+1];
380 tetMax= Pi-Theta_[kt];
381 }
382}
383
384/* --Methode-- */
385//++
386template <class T>
387void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax)
388
389// Return values of phi which limit the jp-th pixel of the kt-th slice
390//--
391{
392 // verification
393 if((kt < 0) || (kt >= 2*NTheta_)) {
394 phiMin= -99999.;
395 phiMax= -99999.;
396 return;
397 }
398
399 // si on se trouve dans l'hemisphere Sud
400 if(kt >= NTheta_) kt= 2*NTheta_-1-kt;
401
402 // verifie si la tranche kt contient au moins jp pixels
403 if( (jp< 0) || (jp >= NPhi_[kt]) ) {
404 phiMin= -88888.;
405 phiMax= -88888.;
406 return;
407 }
408
409 double dphi= DeuxPi/(double)NPhi_[kt];
410 phiMin= dphi*(double)(jp);
411 phiMax= dphi*(double)(jp+1);
412 return;
413}
414
415/* --Methode-- */
416//++
417template <class T>
418int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const
419
420// Return pixel index with sequence index jp in the slice kt
421//--
422{
423 int k;
424 bool fgzn= false;
425
426 // si on se trouve dans l'hemisphere Sud
427 if(kt >= NTheta_) {
428 fgzn= true;
429 kt= 2*NTheta_-1-kt;
430 }
431
432 // si la tranche kt contient au moins i pixels
433 if( (jp>=0) && (jp<NPhi_[kt]) )
434 {
435 // dans l'hemisphere Sud
436 if (fgzn) k= NPix_-TNphi_[kt+1]+jp;
437 // dans l'hemisphere Nord
438 else k= TNphi_[kt]+jp;
439 }
440 else
441 {
442 k= 9999;
443 printf("\n la tranche %d ne contient pas un pixel de rang %d",kt,jp);
444 }
445 return(k);
446}
447
448/* --Methode-- */
449//++
450template <class T>
451void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp)
452
453// Return indices kt (theta) and jp (phi) of pixel with index k
454//--
455{
456 bool fgzn= false;
457 // si on se trouve dans l'hemisphere Sud
458 if(k >= NPix_/2)
459 {
460 fgzn= true;
461 k= NPix_-1-k;
462 }
463
464 // on recupere l'indice kt de la tranche qui contient le pixel k
465 int i;
466 for(i = 0; i < NTheta_; i++)
467 if(k < TNphi_[i+1]) break;
468
469 // indice kt de tranche
470 if (fgzn) kt= 2*NTheta_-1-i;
471 else kt= i;
472
473 // indice jp de pixel
474 if (fgzn) jp= TNphi_[i+1]-k-1;
475 else jp= k-TNphi_[i];
476}
477//++
478template <class T>
479void SphereThetaPhi<T>::Pixelize(int_4 m)
480
481// achieve the splitting into pixels (m has the same signification
482// as for the constructor)
483//
484// Each theta-slice of the north hemisphere will be spitted starting f
485// from phi=0 ...
486//
487// South hemisphere is scanned in the same direction according to phi
488// and from equator to the pole (the pixel following the last one of
489// the slice closest to the equator with z>0, is the pixel with lowest
490// phi of the slice closest of the equator with z<0).
491//--
492{
493 int ntotpix,j;
494
495 // Decodage et controle des arguments d'appel :
496 // au moins 2 et au plus 16384 bandes d'un hemisphere en theta
497 if (m < 2) m = 2;
498 if (m > 16384) m = 16384;
499
500 // On memorise les arguments d'appel
501 NTheta_ = m;
502
503 // On commence par decouper l'hemisphere z>0.
504 // Creation des vecteurs contenant :
505 // Les valeurs limites de theta (une valeur de plus que le nombre de bandes...)
506 Theta_= new double[m+1];
507
508 // Le nombre de pixels en phi de chacune des bandes en theta
509 NPhi_ = new int_4[m];
510
511 // Le nombre/Deuxpi total des pixels contenus dans les bandes de z superieur a une
512 // bande donnee (mTPphi[m] contient le nombre de pixels total de l'hemisphere)
513 TNphi_= new int_4[m+1];
514
515 // Calcul du nombre total de pixels dans chaque bande pour optimiser
516 // le rapport largeur/hauteur des pixels
517
518 //calotte polaire
519 TNphi_[0]= 0;
520 NPhi_[0] = 1;
521
522 //bandes jusqu'a l'equateur
523 for(j = 1; j < m; j++)
524 {
525 TNphi_[j]= TNphi_[j-1]+NPhi_[j-1];
526 NPhi_[j] = (int_4)(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ;
527 }
528
529 // Nombre total de pixels sur l'hemisphere
530 ntotpix = TNphi_[m-1]+NPhi_[m-1];
531 TNphi_[m]= ntotpix;
532 // et sur la sphere entiere
533 NPix_= 2*ntotpix;
534
535 // Creation et initialisation du vecteur des contenus des pixels
536 pixels_.ReSize(NPix_);
537 pixels_.Reset();
538
539 // Determination des limites des bandes en theta :
540 // omeg est l'angle solide couvert par chaque pixel,
541 // une bande donnee kt couvre un angle solide NPhi_[kt]*omeg
542 // egal a 2* Pi*(cos Theta_[kt]-cos Theta_[kt+1]). De meme, l'angle solide
543 //de la
544 // calotte allant du pole a la limite haute de la bande kt vaut
545 // 2* Pi*(1.-cos Theta_[kt+1])= TNphi_[kt]*omeg...
546
547 double omeg2pi= 1./(double)ntotpix;
548 Omega_ = omeg2pi*DeuxPi;
549
550 for(j=0; j <= m; j++)
551 {
552 Theta_[j]= acos(1.-(double)TNphi_[j]*omeg2pi);
553 }
554}
555
556//++
557template <class T>
558void SphereThetaPhi<T>::GetThetaSlice(int_4 index,double& theta, TVector<double>& phi, TVector<T>& value) const
559
560// For a theta-slice with index 'index', return :
561// the corresponding "theta"
562// a vector containing the phi's of the pixels of the slice
563// a vector containing the corresponding values of pixels
564//--
565
566{
567
568 if(index < 0 || index > NbThetaSlices())
569 {
570 // THROW(out_of_range("SphereThetaPhi::PIxVal Pixel index out of range"));
571 cout << " SphereThetaPhi::GetThetaSlice : exceptions a mettre en place" <<endl;
572 THROW(rangeCheckErr);
573 }
574
575 int iring= Index(index,0);
576 int bid = this->NPhi(index);
577 int lring = bid;
578
579 phi.ReSize(lring);
580 value.ReSize(lring);
581 double Te= 0.;
582 double Fi= 0.;
583 for(int kk = 0; kk < lring; kk++)
584 {
585 PixThetaPhi(kk+iring,Te,Fi);
586 phi(kk)= Fi;
587 value(kk)= PixVal(kk+iring);
588 }
589 theta= Te;
590}
591
592template <class T>
593void SphereThetaPhi<T>::setmNPhi(int_4* array, int_4 m)
594 //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta
595 //
596{
597 NPhi_= new int_4[m];
598 for(int k = 0; k < m; k++) NPhi_[k]= array[k];
599}
600
601template <class T>
602void SphereThetaPhi<T>::setmTNphi(int_4* array, int_4 m)
603 //remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes
604 //
605{
606 TNphi_= new int_4[m];
607 for(int k = 0; k < m; k++) TNphi_[k]= array[k];
608}
609
610template <class T>
611void SphereThetaPhi<T>::setmTheta(double* array, int_4 m)
612 //remplit le tableau contenant les valeurs limites de theta
613 //
614{
615 Theta_= new double[m];
616 for(int k = 0; k < m; k++) Theta_[k]= array[k];
617}
618
619template <class T>
620void SphereThetaPhi<T>::setDataBlock(T* data, int_4 m)
621 // remplit le vecteur des contenus des pixels
622{
623 pixels_.FillFrom(m,data);
624}
625
626template <class T>
627void SphereThetaPhi<T>::print(ostream& os) const
628{
629 if(mInfo_) os << " DVList Info= " << *mInfo_ << endl;
630 //
631 os << " NTheta_= " << NTheta_ << endl;
632 os << " NPix_ = " << NPix_ << endl;
633 os << " Omega_ = " << Omega_ << endl;
634
635 os << " contenu de NPhi_ : ";
636 int i;
637 for(i=0; i < NTheta_; i++)
638 {
639 if(i%5 == 0) os << endl;
640 os << NPhi_[i] <<", ";
641 }
642 os << endl;
643
644 os << " contenu de Theta_ : ";
645 for(i=0; i < NTheta_+1; i++)
646 {
647 if(i%5 == 0) os << endl;
648 os << Theta_[i] <<", ";
649 }
650 os << endl;
651
652 os << " contenu de TNphi_ : ";
653 for(i=0; i < NTheta_+1; i++)
654 {
655 if(i%5 == 0) os << endl;
656 os << TNphi_[i] <<", ";
657 }
658 os << endl;
659
660 os << " contenu de pixels : ";
661 for(i=0; i < NPix_; i++)
662 {
663 if(i%5 == 0) os << endl;
664 os << pixels_(i) <<", ";
665 }
666 os << endl;
667}
668
669///////////////////////////////////////////////////////////
670// --------------------------------------------------------
671// Les objets delegues pour la gestion de persistance
672// --------------------------------------------------------
673//////////////////////////////////////////////////////////
674
675template <class T>
676FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi()
677{
678 dobj= new SphereThetaPhi<T>;
679 ownobj= true;
680}
681
682template <class T>
683FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(string const& filename)
684{
685 dobj= new SphereThetaPhi<T>;
686 dobj->DataBlock().SetTemp(true);
687 ownobj= true;
688 Read(filename);
689}
690
691template <class T>
692FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj)
693{
694 dobj= new SphereThetaPhi<T>(obj, true);
695 dobj->DataBlock().SetTemp(true);
696 ownobj= true;
697}
698
699template <class T>
700FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(SphereThetaPhi<T>* obj)
701{
702 dobj= obj;
703 ownobj= false;
704}
705
706template <class T>
707FIO_SphereThetaPhi<T>::~FIO_SphereThetaPhi()
708{
709 if (ownobj && dobj) delete dobj;
710}
711
712template <class T>
713AnyDataObj* FIO_SphereThetaPhi<T>::DataObj()
714{
715 return(dobj);
716}
717
718template <class T>
719void FIO_SphereThetaPhi<T>::ReadSelf(PInPersist& is)
720{
721
722 if(dobj == NULL)
723 {
724 dobj= new SphereThetaPhi<T>;
725 dobj->DataBlock().SetTemp(true);
726 ownobj= true;
727 }
728
729// Let's Read the SphereCoordSys object -- ATTENTIOn - $CHECK$
730 SphereCoordSys* cs = dynamic_cast<SphereCoordSys*>(is.ReadObject());
731 dobj->SetCoordSys(cs);
732
733 // Pour savoir s'il y avait un DVList Info associe
734 char strg[256];
735 is.GetLine(strg, 255);
736 bool hadinfo= false;
737 if(strncmp(strg+strlen(strg)-7, "HasInfo", 7) == 0) hadinfo= true;
738 if(hadinfo)
739 { // Lecture eventuelle du DVList Info
740 is >> dobj->Info();
741 }
742
743 int_4 mNTheta;
744 is.GetI4(mNTheta);
745 dobj->setSizeIndex(mNTheta);
746
747 int_4 mNPix;
748 is.GetI4(mNPix);
749 dobj->setNbPixels(mNPix);
750
751 double mOmeg;
752 is.GetR8(mOmeg);
753 dobj->setPixSolAngle(mOmeg);
754
755 int_4* mNphi= new int_4[mNTheta];
756 is.GetI4s(mNphi, mNTheta);
757 dobj->setmNPhi(mNphi, mNTheta);
758 delete [] mNphi;
759
760 int_4* mTNphi= new int_4[mNTheta+1];
761 is.GetI4s(mTNphi, mNTheta+1);
762 dobj->setmTNphi(mTNphi, mNTheta+1);
763 delete [] mTNphi;
764
765 double* mTheta= new double[mNTheta+1];
766 is.GetR8s(mTheta, mNTheta+1);
767 dobj->setmTheta(mTheta, mNTheta+1);
768 delete [] mTheta;
769
770// On lit le DataBlock;
771 is >> dobj->DataBlock();
772}
773
774template <class T>
775void FIO_SphereThetaPhi<T>::WriteSelf(POutPersist& os) const
776{
777
778 if(dobj == NULL)
779 {
780 cout << " WriteSelf:: dobj= null " << endl;
781 return;
782 }
783
784// Let's write the SphereCoordSys object
785 dobj->GetCoordSys()->Write(os);
786
787 char strg[256];
788 int_4 mNTheta= dobj->SizeIndex();
789 int_4 mNPix = dobj->NbPixels();
790
791 if(dobj->ptrInfo())
792 {
793 sprintf(strg,"SphereThetaPhi: NSlices=%6d NPix=%9d HasInfo",mNTheta,mNPix);
794 os.PutLine(strg);
795 os << dobj->Info();
796 }
797 else
798 {
799 sprintf(strg,"SphereThetaPhi: NSlices=%6d NPix=%9d ",mNTheta,mNPix);
800 os.PutLine(strg);
801 }
802
803 os.PutI4(mNTheta);
804 os.PutI4(mNPix);
805 os.PutR8(dobj->PixSolAngle(0));
806 os.PutI4s(dobj->getmNPhi() , mNTheta);
807 os.PutI4s(dobj->getmTNphi(), mNTheta+1);
808 os.PutR8s(dobj->getmTheta(), mNTheta+1);
809// On ecrit le datablock
810 os << dobj->DataBlock();
811}
812
813#ifdef __CXX_PRAGMA_TEMPLATES__
814#pragma define_template SphereThetaPhi<double>
815#pragma define_template SphereThetaPhi<float>
816#pragma define_template SphereThetaPhi< complex<float> >
817#pragma define_template SphereThetaPhi< complex<double> >
818#pragma define_template FIO_SphereThetaPhi<double>
819#pragma define_template FIO_SphereThetaPhi<float>
820#pragma define_template FIO_SphereThetaPhi< complex<float> >
821#pragma define_template FIO_SphereThetaPhi< complex<double> >
822#endif
823#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
824template class SphereThetaPhi<double>;
825template class SphereThetaPhi<float>;
826template class SphereThetaPhi< complex<float> >;
827template class SphereThetaPhi< complex<double> >;
828template class FIO_SphereThetaPhi<double>;
829template class FIO_SphereThetaPhi<float>;
830template class FIO_SphereThetaPhi< complex<float> >;
831template class FIO_SphereThetaPhi< complex<double> >;
832#endif
Note: See TracBrowser for help on using the repository browser.