Changeset 2082 in Sophya for trunk/SophyaLib/SkyMap
- Timestamp:
- Jul 3, 2002, 3:29:50 PM (23 years ago)
- Location:
- trunk/SophyaLib/SkyMap
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/HEALPixUtils.cc
r1954 r2082 142 142 else 143 143 { 144 ID = (int)fmod(J,2);144 ID = J%2; //RzModFloor (int)fmod(J,2); 145 145 J = J/2; 146 146 K = IP*ID+K; … … 232 232 if( jp<1 ) jp = jp + nl4; 233 233 234 int aux=n_before + jp - 1;234 //RzDel int aux=n_before + jp - 1; 235 235 return (n_before + jp - 1);// ! in {0, npix-1} 236 236 } … … 295 295 296 296 ip = ipring1 - ncap - 1; 297 irn = (int)floor( ip / nl4 ) + nside;//! counted from North pole298 iphi = (int)fmod(ip,nl4) + 1;299 300 kshift = (i nt)fmod(irn+nside,2);//! 1 if irn+nside is odd, 0 otherwise297 irn = ip / nl4 + nside; //RzModFloor (int)floor( ip / nl4 ) + nside; ! counted from North pole 298 iphi = ip%nl4 + 1; //RzModFloor (int)fmod(ip,nl4) + 1; 299 300 kshift = (irn+nside)%2; //RzModFloor (int)fmod(irn+nside,2); ! 1 if irn+nside is odd, 0 otherwise 301 301 nr = nside; 302 302 ire = irn - nside + 1;// ! in {1, 2*nside +1} … … 305 305 ifp = (iphi - irm/2 + nside -1) / nside; 306 306 if( ifp==ifm ) {//then ! faces 4 to 7 307 face_num = (int)fmod(ifp,4) + 4;307 face_num = ifp%4+4; // RzModFloor (int)fmod(ifp,4) + 4; 308 308 } 309 309 else if( ifp + 1==ifm ) {//then ! (half-)faces 0 to 3 … … 338 338 iy = -(ipt + irt ) / 2; 339 339 340 ix_low = (int)fmod(ix,128);340 ix_low = ix%128; //RzModFloor (int)fmod(ix,128); 341 341 ix_hi = ix/128; 342 iy_low = (int)fmod(iy,128);342 iy_low = iy%128; //RzModFloor (int)fmod(iy,128); 343 343 iy_hi = iy/128; 344 344 ipf=(PXY.x2pix_(ix_hi)+PXY.y2pix_(iy_hi))*(128*128)+(PXY.x2pix_(ix_low)+PXY.y2pix_(iy_low)); … … 397 397 ir = nside + 1 + jp - jm;// ! in {1,2n+1} (ring number counted from z=2/3) 398 398 kshift = 0; 399 if (fmod(ir,2)==0.) kshift = 1;// ! kshift=1 if ir even, 0 otherwise 400 401 ip = (int)floor( ( jp+jm - nside + kshift + 1 ) / 2 ) + 1;// ! in {1,4n} 399 //RzModFloor if (fmod(ir,2)==0.) kshift = 1; ! kshift=1 if ir even, 0 otherwise 400 if ((ir%2)==0) kshift = 1;// ! kshift=1 if ir even, 0 otherwise 401 402 //RzModFloor ip = (int)floor( ( jp+jm - nside + kshift + 1 ) / 2 ) + 1; ! in {1,4n} 403 ip = ( jp+jm - nside + kshift + 1 )/2 + 1; 402 404 if( ip>nl4 ) ip = ip - nl4; 403 405 … … 477 479 ifp = jp / ns_max;// ! in {0,4} 478 480 ifm = jm / ns_max; 479 if( ifp==ifm ) face_num = (i nt)fmod(ifp,4) + 4; //then ! faces 4 to 7480 else if( ifp<ifm ) face_num = (int)fmod(ifp,4); //(half-)faces 0 to 3481 else face_num = (i nt)fmod(ifm,4) + 8;//! (half-)faces 8 to 11482 483 ix = (int)fmod(jm, ns_max);484 iy = ns_max - ( int)fmod(jp, ns_max) - 1;481 if( ifp==ifm ) face_num = (ifp%4)+4; //RzModFloor (int)fmod(ifp,4) + 4; then ! faces 4 to 7 482 else if( ifp<ifm ) face_num = ifp%4; //RzModFloor (int)fmod(ifp,4); (half-)faces 0 to 3 483 else face_num = (ifm%4) + 8; //RzModFloor (int)fmod(ifm,4) + 8;! (half-)faces 8 to 11 484 485 ix = jm%ns_max; //RzModFloor (int)fmod(jm, ns_max); 486 iy = ns_max - (jp%ns_max) - 1;//RzModFloor ns_max - (int)fmod(jp, ns_max) - 1; 485 487 } 486 488 else { //! polar region, za > 2/3 … … 510 512 } 511 513 512 ix_low = (i nt)fmod(ix,128);514 ix_low = (ix%128); //RzModFloor (int)fmod(ix,128); 513 515 ix_hi = ix/128; 514 iy_low = (i nt)fmod(iy,128);516 iy_low = (iy%128); //RzModFloor ((int)fmod(iy,128); 515 517 iy_hi = iy/128; 516 518 ipf= (PXY.x2pix_(ix_hi)+PXY.y2pix_(iy_hi))*(128*128)+(PXY.x2pix_(ix_low)+PXY.y2pix_(iy_low)); … … 571 573 572 574 ip = ipix1 - ncap - 1; 573 iring = (int)floor( ip / nl4 ) + nside;//! counted from North pole575 iring = ip/nl4 + nside; //RzModFloor (int)floor( ip / nl4 ) + nside; ! counted from North pole 574 576 iphi = ip%nl4 + 1; 575 577 … … 639 641 640 642 face_num = ipix/npface;// ! face number in {0,11} 641 ipf = (int)fmod(ipix,npface);//! pixel number in the face {0,npface-1}643 ipf = ipix%npface; //RzModFloor (int)fmod(ipix,npface); ! pixel number in the face {0,npface-1} 642 644 643 645 //c finds the x,y on the face (starting from the lowest corner) 644 646 //c from the pixel number 645 ip_low = (int)fmod(ipf,1024);//! content of the last 10 bits647 ip_low = ipf%1024; //RzModFloor (int)fmod(ipf,1024); ! content of the last 10 bits 646 648 ip_trunc = ipf/1024 ;// ! truncation of the last 10 bits 647 ip_med = (int)fmod(ip_trunc,1024);//! content of the next 10 bits649 ip_med = ip_trunc%1024; //RzModFloor (int)fmod(ip_trunc,1024); ! content of the next 10 bits 648 650 ip_hi = ip_trunc/1024 ;//! content of the high weight 10 bits 649 651 … … 660 662 nr = nside;// ! equatorial region (the most frequent) 661 663 z = (2*nside-jr)*fact2; 662 kshift = ( int)fmod(jr - nside, 2);664 kshift = (jr-nside) % 2; //RzModFloor (int)fmod(jr - nside, 2); 663 665 if( jr<nside ) { //then ! north pole region 664 666 nr = jr; -
trunk/SophyaLib/SkyMap/fiospherehealpix.cc
r1955 r2082 163 163 164 164 #ifdef __CXX_PRAGMA_TEMPLATES__ 165 #pragma define_template FIO_SphereHEALPix<int_4> 165 166 #pragma define_template FIO_SphereHEALPix<r_8> 166 167 #pragma define_template FIO_SphereHEALPix<r_4> … … 169 170 #endif 170 171 #if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES) 172 template class FIO_SphereHEALPix<int_4>; 171 173 template class FIO_SphereHEALPix<r_8>; 172 174 template class FIO_SphereHEALPix<r_4>; -
trunk/SophyaLib/SkyMap/skymapinit.cc
r1371 r2082 31 31 // Enregistrement des classes PPersist du module SkyMap 32 32 33 // ---------- Les SphereThetaPhi --------- 34 33 35 PPRegister(FIO_SphereCoordSys); 34 36 DObjRegister(FIO_SphereCoordSys, SphereCoordSys); 37 38 PPRegister(FIO_SphereThetaPhi<int_4>); 39 DObjRegister(FIO_SphereThetaPhi<int_4>, SphereThetaPhi<int_4>); 35 40 36 41 PPRegister(FIO_SphereThetaPhi<r_4>); … … 46 51 DObjRegister(FIO_SphereThetaPhi< complex<r_8> >, SphereThetaPhi< complex<r_8> >); 47 52 53 54 // ---------- Les SphereHEALPix --------- 55 56 PPRegister(FIO_SphereHEALPix<int_4>); 57 DObjRegister(FIO_SphereHEALPix<int_4>, SphereHEALPix<int_4>); 58 48 59 PPRegister(FIO_SphereHEALPix<r_4>); 49 60 DObjRegister(FIO_SphereHEALPix<r_4>, SphereHEALPix<r_4>); … … 57 68 PPRegister(FIO_SphereHEALPix< complex<r_8> >); 58 69 DObjRegister(FIO_SphereHEALPix< complex<r_8> >, SphereHEALPix< complex<r_8> >); 70 71 // ------------ Les LocalMap --------- 72 PPRegister(FIO_LocalMap<int_4>); 73 DObjRegister(FIO_LocalMap<int_4>, LocalMap<int_4>); 59 74 60 75 PPRegister(FIO_LocalMap<r_4>); -
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r1624 r2082 832 832 833 833 #ifdef __CXX_PRAGMA_TEMPLATES__ 834 #pragma define_template SphereThetaPhi<int_4> 834 835 #pragma define_template SphereThetaPhi<r_8> 835 836 #pragma define_template SphereThetaPhi<r_4> … … 838 839 #endif 839 840 #if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES) 841 template class SphereThetaPhi<int_4>; 840 842 template class SphereThetaPhi<r_8>; 841 843 template class SphereThetaPhi<r_4>;
Note:
See TracChangeset
for help on using the changeset viewer.