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

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

mise a jour de persistances par objets delegues

File size: 18.9 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 return( 2*NTheta_);
325}
326
327/* --Methode-- */
328//++
329template <class T>
330int_4 SphereThetaPhi<T>::NPhi(int_4 kt) const
331
332// Return number of pixels in phi-direction of the kt-th slice
333//--
334{
335 int nbpix;
336 // verification
337 if((kt < 0) || (kt >= 2*NTheta_)) return(-1);
338
339 // si on se trouve dans l'hemisphere Sud
340 if(kt >= NTheta_) {
341 kt= 2*NTheta_-1-kt;
342 }
343
344 // nombre de pixels
345 nbpix= NPhi_[kt];
346 return(nbpix);
347}
348
349
350/* --Methode-- */
351//++
352template <class T>
353void SphereThetaPhi<T>::Theta(int_4 kt,double& tetMin,double& tetMax)
354
355// Return theta values which limit the slice kt
356//--
357{
358 bool fgzn= false;
359 // verification
360 if( (kt< 0) || (kt>= 2*NTheta_) ) {
361 tetMin= -99999.;
362 tetMax= -99999.;
363 return;
364 }
365
366 // si on se trouve dans l'hemisphere Sud
367 if( kt >= NTheta_ ) {
368 fgzn= true;
369 kt= 2*NTheta_-1-kt;
370 }
371
372 // valeurs limites de theta dans l'hemisphere Nord
373 tetMin= Theta_[kt];
374 tetMax= Theta_[kt+1];
375 // valeurs limites de theta dans l'hemisphere Sud
376 if (fgzn) {
377 tetMin= Pi-Theta_[kt+1];
378 tetMax= Pi-Theta_[kt];
379 }
380}
381
382/* --Methode-- */
383//++
384template <class T>
385void SphereThetaPhi<T>::Phi(int_4 kt,int_4 jp,double& phiMin,double& phiMax)
386
387// Return values of phi which limit the jp-th pixel of the kt-th slice
388//--
389{
390 // verification
391 if((kt < 0) || (kt >= 2*NTheta_)) {
392 phiMin= -99999.;
393 phiMax= -99999.;
394 return;
395 }
396
397 // si on se trouve dans l'hemisphere Sud
398 if(kt >= NTheta_) kt= 2*NTheta_-1-kt;
399
400 // verifie si la tranche kt contient au moins jp pixels
401 if( (jp< 0) || (jp >= NPhi_[kt]) ) {
402 phiMin= -88888.;
403 phiMax= -88888.;
404 return;
405 }
406
407 double dphi= DeuxPi/(double)NPhi_[kt];
408 phiMin= dphi*(double)(jp);
409 phiMax= dphi*(double)(jp+1);
410 return;
411}
412
413/* --Methode-- */
414//++
415template <class T>
416int_4 SphereThetaPhi<T>::Index(int_4 kt,int_4 jp) const
417
418// Return pixel index with sequence index jp in the slice kt
419//--
420{
421 int k;
422 bool fgzn= false;
423
424 // si on se trouve dans l'hemisphere Sud
425 if(kt >= NTheta_) {
426 fgzn= true;
427 kt= 2*NTheta_-1-kt;
428 }
429
430 // si la tranche kt contient au moins i pixels
431 if( (jp>=0) && (jp<NPhi_[kt]) )
432 {
433 // dans l'hemisphere Sud
434 if (fgzn) k= NPix_-TNphi_[kt+1]+jp;
435 // dans l'hemisphere Nord
436 else k= TNphi_[kt]+jp;
437 }
438 else
439 {
440 k= 9999;
441 printf("\n la tranche %d ne contient pas un pixel de rang %d",kt,jp);
442 }
443 return(k);
444}
445
446/* --Methode-- */
447//++
448template <class T>
449void SphereThetaPhi<T>::ThetaPhiIndex(int_4 k,int_4& kt,int_4& jp)
450
451// Return indices kt (theta) and jp (phi) of pixel with index k
452//--
453{
454 bool fgzn= false;
455 // si on se trouve dans l'hemisphere Sud
456 if(k >= NPix_/2)
457 {
458 fgzn= true;
459 k= NPix_-1-k;
460 }
461
462 // on recupere l'indice kt de la tranche qui contient le pixel k
463 int i;
464 for(i = 0; i < NTheta_; i++)
465 if(k < TNphi_[i+1]) break;
466
467 // indice kt de tranche
468 if (fgzn) kt= 2*NTheta_-1-i;
469 else kt= i;
470
471 // indice jp de pixel
472 if (fgzn) jp= TNphi_[i+1]-k-1;
473 else jp= k-TNphi_[i];
474}
475//++
476template <class T>
477void SphereThetaPhi<T>::Pixelize(int_4 m)
478
479// achieve the splitting into pixels (m has the same signification
480// as for the constructor)
481//
482// Each theta-slice of the north hemisphere will be spitted starting f
483// from phi=0 ...
484//
485// South hemisphere is scanned in the same direction according to phi
486// and from equator to the pole (the pixel following the last one of
487// the slice closest to the equator with z>0, is the pixel with lowest
488// phi of the slice closest of the equator with z<0).
489//--
490{
491 int ntotpix,j;
492
493 // Decodage et controle des arguments d'appel :
494 // au moins 2 et au plus 16384 bandes d'un hemisphere en theta
495 if (m < 2) m = 2;
496 if (m > 16384) m = 16384;
497
498 // On memorise les arguments d'appel
499 NTheta_ = m;
500
501 // On commence par decouper l'hemisphere z>0.
502 // Creation des vecteurs contenant :
503 // Les valeurs limites de theta (une valeur de plus que le nombre de bandes...)
504 Theta_= new double[m+1];
505
506 // Le nombre de pixels en phi de chacune des bandes en theta
507 NPhi_ = new int_4[m];
508
509 // Le nombre/Deuxpi total des pixels contenus dans les bandes de z superieur a une
510 // bande donnee (mTPphi[m] contient le nombre de pixels total de l'hemisphere)
511 TNphi_= new int_4[m+1];
512
513 // Calcul du nombre total de pixels dans chaque bande pour optimiser
514 // le rapport largeur/hauteur des pixels
515
516 //calotte polaire
517 TNphi_[0]= 0;
518 NPhi_[0] = 1;
519
520 //bandes jusqu'a l'equateur
521 for(j = 1; j < m; j++)
522 {
523 TNphi_[j]= TNphi_[j-1]+NPhi_[j-1];
524 NPhi_[j] = (int_4)(.5+4.*(double)(m-.5)*sin(Pi*(double)j/(double)(2.*m-1.))) ;
525 }
526
527 // Nombre total de pixels sur l'hemisphere
528 ntotpix = TNphi_[m-1]+NPhi_[m-1];
529 TNphi_[m]= ntotpix;
530 // et sur la sphere entiere
531 NPix_= 2*ntotpix;
532
533 // Creation et initialisation du vecteur des contenus des pixels
534 pixels_.ReSize(NPix_);
535 pixels_.Reset();
536
537 // Determination des limites des bandes en theta :
538 // omeg est l'angle solide couvert par chaque pixel,
539 // une bande donnee kt couvre un angle solide NPhi_[kt]*omeg
540 // egal a 2* Pi*(cos Theta_[kt]-cos Theta_[kt+1]). De meme, l'angle solide
541 //de la
542 // calotte allant du pole a la limite haute de la bande kt vaut
543 // 2* Pi*(1.-cos Theta_[kt+1])= TNphi_[kt]*omeg...
544
545 double omeg2pi= 1./(double)ntotpix;
546 Omega_ = omeg2pi*DeuxPi;
547
548 for(j=0; j <= m; j++)
549 {
550 Theta_[j]= acos(1.-(double)TNphi_[j]*omeg2pi);
551 }
552}
553
554//++
555template <class T>
556void SphereThetaPhi<T>::GetThetaSlice(int_4 index,double& theta, TVector<double>& phi, TVector<T>& value) const
557
558// For a theta-slice with index 'index', return :
559// the corresponding "theta"
560// a vector containing the phi's of the pixels of the slice
561// a vector containing the corresponding values of pixels
562//--
563
564{
565
566 if(index < 0 || index >= NbThetaSlices())
567 {
568 // THROW(out_of_range("SphereThetaPhi::PIxVal Pixel index out of range"));
569 cout << " SphereThetaPhi::GetThetaSlice : Pixel index out of range" <<endl;
570 THROW(rangeCheckErr);
571 }
572
573 int iring= Index(index,0);
574 int lring = NPhi(index);
575
576 phi.ReSize(lring);
577 value.ReSize(lring);
578 double Te= 0.;
579 double Fi= 0.;
580 for(int kk = 0; kk < lring; kk++)
581 {
582 PixThetaPhi(kk+iring,Te,Fi);
583 phi(kk)= Fi;
584 value(kk)= PixVal(kk+iring);
585 }
586 theta= Te;
587}
588
589template <class T>
590void SphereThetaPhi<T>::setmNPhi(int_4* array, int_4 m)
591 //remplit le tableau contenant le nombre de pixels en phi de chacune des bandes en theta
592 //
593{
594 NPhi_= new int_4[m];
595 for(int k = 0; k < m; k++) NPhi_[k]= array[k];
596}
597
598template <class T>
599void SphereThetaPhi<T>::setmTNphi(int_4* array, int_4 m)
600 //remplit le tableau contenant le nombre/Deuxpi total des pixels contenus dans les bandes
601 //
602{
603 TNphi_= new int_4[m];
604 for(int k = 0; k < m; k++) TNphi_[k]= array[k];
605}
606
607template <class T>
608void SphereThetaPhi<T>::setmTheta(double* array, int_4 m)
609 //remplit le tableau contenant les valeurs limites de theta
610 //
611{
612 Theta_= new double[m];
613 for(int k = 0; k < m; k++) Theta_[k]= array[k];
614}
615
616
617template <class T>
618void SphereThetaPhi<T>::print(ostream& os) const
619{
620 if(mInfo_) os << " DVList Info= " << *mInfo_ << endl;
621 //
622 os << " NTheta_= " << NTheta_ << endl;
623 os << " NPix_ = " << NPix_ << endl;
624 os << " Omega_ = " << Omega_ << endl;
625
626 os << " contenu de NPhi_ : ";
627 int i;
628 for(i=0; i < NTheta_; i++)
629 {
630 if(i%5 == 0) os << endl;
631 os << NPhi_[i] <<", ";
632 }
633 os << endl;
634
635 os << " contenu de Theta_ : ";
636 for(i=0; i < NTheta_+1; i++)
637 {
638 if(i%5 == 0) os << endl;
639 os << Theta_[i] <<", ";
640 }
641 os << endl;
642
643 os << " contenu de TNphi_ : ";
644 for(i=0; i < NTheta_+1; i++)
645 {
646 if(i%5 == 0) os << endl;
647 os << TNphi_[i] <<", ";
648 }
649 os << endl;
650
651 os << " contenu de pixels : ";
652 for(i=0; i < NPix_; i++)
653 {
654 if(i%5 == 0) os << endl;
655 os << pixels_(i) <<", ";
656 }
657 os << endl;
658}
659
660///////////////////////////////////////////////////////////
661// --------------------------------------------------------
662// Les objets delegues pour la gestion de persistance
663// --------------------------------------------------------
664//////////////////////////////////////////////////////////
665
666template <class T>
667FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi()
668{
669 dobj= new SphereThetaPhi<T>;
670 ownobj= true;
671}
672
673template <class T>
674FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(string const& filename)
675{
676 dobj= new SphereThetaPhi<T>;
677 // dobj->DataBlock().SetTemp(true);
678 dobj->pixels_.SetTemp(true);
679 ownobj= true;
680 Read(filename);
681}
682
683template <class T>
684FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(const SphereThetaPhi<T>& obj)
685{
686 dobj= new SphereThetaPhi<T>(obj, true);
687 // dobj->DataBlock().SetTemp(true);
688 dobj->pixels_.SetTemp(true);
689 ownobj= true;
690}
691
692template <class T>
693FIO_SphereThetaPhi<T>::FIO_SphereThetaPhi(SphereThetaPhi<T>* obj)
694{
695 dobj= obj;
696 ownobj= false;
697}
698
699template <class T>
700FIO_SphereThetaPhi<T>::~FIO_SphereThetaPhi()
701{
702 if (ownobj && dobj) delete dobj;
703}
704
705template <class T>
706AnyDataObj* FIO_SphereThetaPhi<T>::DataObj()
707{
708 return(dobj);
709}
710
711template <class T>
712void FIO_SphereThetaPhi<T>::ReadSelf(PInPersist& is)
713{
714
715 if(dobj == NULL)
716 {
717 dobj= new SphereThetaPhi<T>;
718 // dobj->DataBlock().SetTemp(true);
719 dobj->pixels_.SetTemp(true);
720 ownobj= true;
721 }
722
723// Let's Read the SphereCoordSys object -- ATTENTIOn - $CHECK$
724 FIO_SphereCoordSys fio_scs( dobj->GetCoordSys());
725 fio_scs.Read(is);
726
727 // Pour savoir s'il y avait un DVList Info associe
728 char strg[256];
729 is.GetLine(strg, 255);
730 bool hadinfo= false;
731 if(strncmp(strg+strlen(strg)-7, "HasInfo", 7) == 0) hadinfo= true;
732 if(hadinfo)
733 { // Lecture eventuelle du DVList Info
734 is >> dobj->Info();
735 }
736
737 int_4 mNTheta;
738 is.GetI4(mNTheta);
739 int_4 mNPix;
740 is.GetI4(mNPix);
741 double mOmeg;
742 is.GetR8(mOmeg);
743 dobj->setParameters(mNPix, mOmeg, mNTheta);
744
745 int_4* mNphi= new int_4[mNTheta];
746 is.GetI4s(mNphi, mNTheta);
747 dobj->setmNPhi(mNphi, mNTheta);
748 delete [] mNphi;
749
750 int_4* mTNphi= new int_4[mNTheta+1];
751 is.GetI4s(mTNphi, mNTheta+1);
752 dobj->setmTNphi(mTNphi, mNTheta+1);
753 delete [] mTNphi;
754
755 double* mTheta= new double[mNTheta+1];
756 is.GetR8s(mTheta, mNTheta+1);
757 dobj->setmTheta(mTheta, mNTheta+1);
758 delete [] mTheta;
759
760// On lit le DataBlock;
761 //FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
762FIO_NDataBlock<T> fio_nd(&dobj->pixels_);
763fio_nd.Read(is);
764// is >> dobj->DataBlock();
765}
766
767template <class T>
768void FIO_SphereThetaPhi<T>::WriteSelf(POutPersist& os) const
769{
770
771 if(dobj == NULL)
772 {
773 cout << " WriteSelf:: dobj= null " << endl;
774 return;
775 }
776
777// Let's write the SphereCoordSys object
778 FIO_SphereCoordSys fio_scs( dobj->GetCoordSys());
779 fio_scs.Write(os);
780
781 char strg[256];
782 int_4 mNTheta= dobj->SizeIndex();
783 int_4 mNPix = dobj->NbPixels();
784
785 if(dobj->ptrInfo())
786 {
787 sprintf(strg,"SphereThetaPhi: NSlices=%6d NPix=%9d HasInfo",mNTheta,mNPix);
788 os.PutLine(strg);
789 os << dobj->Info();
790 }
791 else
792 {
793 sprintf(strg,"SphereThetaPhi: NSlices=%6d NPix=%9d ",mNTheta,mNPix);
794 os.PutLine(strg);
795 }
796
797 os.PutI4(mNTheta);
798 os.PutI4(mNPix);
799 os.PutR8(dobj->PixSolAngle());
800 os.PutI4s(dobj->getmNPhi() , mNTheta);
801 os.PutI4s(dobj->getmTNphi(), mNTheta+1);
802 os.PutR8s(dobj->getmTheta(), mNTheta+1);
803// On ecrit le datablock
804 //FIO_NDataBlock<T> fio_nd(&dobj->DataBlock());
805FIO_NDataBlock<T> fio_nd(&dobj->pixels_);
806fio_nd.Write(os);
807// os << dobj->DataBlock();
808}
809
810#ifdef __CXX_PRAGMA_TEMPLATES__
811#pragma define_template SphereThetaPhi<double>
812#pragma define_template SphereThetaPhi<float>
813#pragma define_template SphereThetaPhi< complex<float> >
814#pragma define_template SphereThetaPhi< complex<double> >
815#pragma define_template FIO_SphereThetaPhi<double>
816#pragma define_template FIO_SphereThetaPhi<float>
817#pragma define_template FIO_SphereThetaPhi< complex<float> >
818#pragma define_template FIO_SphereThetaPhi< complex<double> >
819#endif
820#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
821template class SphereThetaPhi<double>;
822template class SphereThetaPhi<float>;
823template class SphereThetaPhi< complex<float> >;
824template class SphereThetaPhi< complex<double> >;
825template class FIO_SphereThetaPhi<double>;
826template class FIO_SphereThetaPhi<float>;
827template class FIO_SphereThetaPhi< complex<float> >;
828template class FIO_SphereThetaPhi< complex<double> >;
829#endif
Note: See TracBrowser for help on using the repository browser.