Changeset 697 in Sophya
- Timestamp:
- Jan 3, 2000, 10:36:55 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/spheregorski.cc
r682 r697 345 345 //-- 346 346 { 347 cout << "entree GetThetaSlice, couche no " << index << endl; 348 349 if (index<0 || index > NbThetaSlices()) 347 348 if (index<0 || index >= NbThetaSlices()) 350 349 { 351 350 // THROW(out_of_range("SphereGorski::PIxVal Pixel index out of range")); 352 cout << " SphereGorski::GetThetaSlice : exceptions a mettre en place" <<endl;351 cout << " SphereGorski::GetThetaSlice : Pixel index out of range" <<endl; 353 352 THROW(rangeCheckErr); 354 353 } … … 397 396 { 398 397 // THROW(out_of_range("SphereGorski::PIxVal Pixel index out of range")); 399 cout << " SphereGorski::PIxVal : exception s a mettre en place"<<endl;398 cout << " SphereGorski::PIxVal : exception a mettre en place, k= " << k <<endl; 400 399 THROW(rangeCheckErr); 401 400 } … … 414 413 { 415 414 //THROW(out_of_range("SphereGorski::PIxVal Pixel index out of range")); 416 cout << " SphereGorski::PIxVal : exception s a mettre en place"<<endl;415 cout << " SphereGorski::PIxVal : exception a mettre en place, k= " << k <<endl; 417 416 THROW(rangeCheckErr); 418 417 } … … 677 676 678 677 hip = ipring1/2.; 679 fihip = (int)floor ( hip );678 fihip = floor ( hip ); 680 679 irn = (int)floor( sqrt( hip - sqrt(fihip) ) ) + 1;// ! counted from North pole 681 680 iphi = ipring1 - 2*irn*(irn - 1); … … 954 953 955 954 theta = acos( 1. - iring*iring / fact2 ); 956 phi = ( 1.*iphi - 0.5) * Pi/(2.*iring);955 phi = ((double)iphi - 0.5) * Pi/(2.*iring); 957 956 // cout << theta << " " << phi << endl; 958 957 } … … 961 960 ip = ipix1 - ncap - 1; 962 961 iring = (int)floor( ip / nl4 ) + nside;// ! counted from North pole 963 iphi = (int)fmod(ip,nl4)+ 1;964 965 fodd = 0.5 * (1 + fmod((double)(iring+nside),2));// ! 1 if iring+nside is odd, 1/2 otherwise962 iphi = ip%nl4 + 1; 963 964 fodd = 0.5 * (1 + (iring+nside)%2 );// ! 1 if iring+nside is odd, 1/2 otherwise 966 965 theta = acos( (nl2 - iring) / fact1 ); 967 phi = ( 1.*iphi - fodd) * Pi /(2.*nside);966 phi = ((double)iphi - fodd) * Pi /(2.*nside); 968 967 } 969 968 else {//! South Polar cap ----------------------------------- … … 971 970 ip = npix - ipix1 + 1; 972 971 hip = ip/2.; 973 fihip = 1.*hip;972 fihip = floor(hip); 974 973 iring = (int)floor( sqrt( hip - sqrt(fihip) ) ) + 1;// ! counted from South pole 975 974 iphi = (int)(4.*iring + 1 - (ip - 2.*iring*(iring-1))); 976 975 977 976 theta = acos( -1. + iring*iring / fact2 ); 978 phi = ( 1.*iphi - 0.5) * Pi/(2.*iring);977 phi = ((double)iphi - 0.5) * Pi/(2.*iring); 979 978 // cout << theta << " " << phi << endl; 980 979 }
Note:
See TracChangeset
for help on using the changeset viewer.