Changeset 697 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Jan 3, 2000, 10:36:55 AM (26 years ago)
Author:
ansari
Message:

correction de la traduction en c++ de l'interface avec la pixelisation Gorski (pix2ang_ring)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/spheregorski.cc

    r682 r697  
    345345//--
    346346{
    347   cout << "entree GetThetaSlice, couche no " << index << endl;
    348 
    349   if (index<0 || index > NbThetaSlices())
     347
     348  if (index<0 || index >= NbThetaSlices())
    350349    {
    351350      // 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;
    353352      THROW(rangeCheckErr);
    354353    }
     
    397396    {
    398397      // THROW(out_of_range("SphereGorski::PIxVal Pixel index out of range"));
    399       cout << " SphereGorski::PIxVal : exceptions  a mettre en place" <<endl;
     398      cout << " SphereGorski::PIxVal : exception  a mettre en place, k= " << k <<endl;
    400399      THROW(rangeCheckErr);
    401400    }
     
    414413    {
    415414      //THROW(out_of_range("SphereGorski::PIxVal Pixel index out of range"));
    416       cout << " SphereGorski::PIxVal : exceptions  a mettre en place" <<endl;
     415      cout << " SphereGorski::PIxVal : exception  a mettre en place, k= " << k <<endl;
    417416      THROW(rangeCheckErr);
    418417    }
     
    677676   
    678677    hip   = ipring1/2.;
    679     fihip = (int)floor ( hip );
     678    fihip = floor ( hip );
    680679    irn   = (int)floor( sqrt( hip - sqrt(fihip) ) ) + 1;// ! counted from North pole
    681680    iphi  = ipring1 - 2*irn*(irn - 1);
     
    954953   
    955954    theta = acos( 1. - iring*iring / fact2 );
    956     phi   = (1.*iphi - 0.5) * Pi/(2.*iring);
     955    phi   = ((double)iphi - 0.5) * Pi/(2.*iring);
    957956    //    cout << theta << " " << phi << endl;
    958957  }
     
    961960    ip    = ipix1 - ncap - 1;
    962961    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 otherwise
     962    iphi  = ip%nl4 + 1;
     963   
     964    fodd  = 0.5 * (1 + (iring+nside)%2 );//  ! 1 if iring+nside is odd, 1/2 otherwise
    966965    theta = acos( (nl2 - iring) / fact1 );
    967     phi   = (1.*iphi - fodd) * Pi /(2.*nside);
     966    phi   = ((double)iphi - fodd) * Pi /(2.*nside);
    968967  }
    969968  else {//! South Polar cap -----------------------------------
     
    971970    ip    = npix - ipix1 + 1;
    972971    hip   = ip/2.;
    973     fihip = 1.*hip;
     972    fihip = floor(hip);
    974973    iring = (int)floor( sqrt( hip - sqrt(fihip) ) ) + 1;//     ! counted from South pole
    975974    iphi  = (int)(4.*iring + 1 - (ip - 2.*iring*(iring-1)));
    976975   
    977976    theta = acos( -1. + iring*iring / fact2 );
    978     phi   = (1.*iphi - 0.5) * Pi/(2.*iring);
     977    phi   = ((double)iphi - 0.5) * Pi/(2.*iring);
    979978    //    cout << theta << " " << phi << endl;
    980979  }
Note: See TracChangeset for help on using the changeset viewer.