Changeset 905 in Sophya
- Timestamp:
- Apr 13, 2000, 12:12:47 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/PMixer/tgsky.cc
r856 r905 29 29 cout << " - TypSky = 1 Params= m,sig , OOFNoise(sig) + m" << endl; 30 30 cout << " - TypSky = 2 Params= K,a,b,m K*cos(a*teta)*sin(b*phi)+m" << endl; 31 cout << " - TypSky = 3 Params= theta,phi DIPOLE" << endl; 31 32 exit(0); 32 33 } … … 40 41 int typ = atoi(arg[2]); 41 42 double m,s,a,b,K; 43 double Theta,Phi; 44 Theta = 0.; 45 Phi = 0.; 42 46 m = 0.; 43 47 s = 1.; 44 48 a = b = 1.; 45 49 K = 1.; 46 if ((typ < 0) || (typ > 2)) typ = 0;50 if ((typ < 0) || (typ > 3)) typ = 0; 47 51 if (typ < 2) { 48 52 sscanf(arg[3],"%lg,%lg",&m,&s); … … 51 55 else cout << " ---> NoiseGenerator() " << endl; 52 56 } 53 else {57 else if(typ==2) { 54 58 sscanf(arg[3],"%lg,%lg,%lg,%lg",&K,&a,&b,&m); 55 59 cout << " TypSky= " << typ << " K= " << m << " a= " << a << " b=" 56 60 << b << " m= " << m << endl; 57 61 cout << " ---> K * cos(a*teta) * sin(b*teta) + m" << endl; 62 } 63 else if(typ==3) { 64 sscanf(arg[3],"%lg,%lg",&Theta,&Phi); 65 cout << " TypSky= " << typ << " Theta= " << Theta << " phi= " << Phi ; 66 cout << " ---> DIPOLE " << endl; 58 67 } 59 68 … … 66 75 } 67 76 } 68 else { 77 else if(typ==3) 78 { 79 UnitVector vd(Theta,Phi); 80 UnitVector vc(Theta,Phi); 81 for(int i=0; i<sph.NbPixels(); i++) 82 { 83 double Thetar,Phir; 84 sph.PixThetaPhi(i,Thetar,Phir); 85 vc.SetThetaPhi(Thetar, Phir); 86 sph(i) += vd.Psc(vc); 87 } 88 } 89 else{ 69 90 NoiseGenerator * ng; 70 91 if (typ == 0) ng = new NoiseGenerator(s);
Note:
See TracChangeset
for help on using the changeset viewer.