Ignore:
Timestamp:
Dec 5, 2002, 4:43:59 PM (23 years ago)
Author:
lemeur
Message:

protections de dimensions

File:
1 edited

Legend:

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

    r1756 r2291  
    169169  // le Resize est suppose mettre a zero
    170170  map.Resize(pixelSizeIndex);
    171   char* sphere_type=map.TypeOfMap();
     171  string sphere_type=map.TypeOfMap();
    172172      int premiereTranche = 0;
    173173      int derniereTranche = map.NbThetaSlices()-1;
    174   if (strncmp(sphere_type,"RING",4) == 0)
     174  if (sphere_type.substr(0,4) == "RING")
    175175  {
    176176    nsmax=map.SizeIndex();
     
    182182    // en vue de l'application du critere Healpix : nlmax<=3*nsmax-1
    183183    // c'est approximatif ; a raffiner.
    184     if (strncmp(sphere_type,"TETAFI",6) == 0)
     184    if (sphere_type.substr(0,6) == "TETAFI")
    185185    {
    186186      nsmax=(int_4)sqrt(map.NbPixels()/12.);
     
    706706  mapq.Resize(pixelSizeIndex);
    707707  mapu.Resize(pixelSizeIndex);
    708   char* sphere_type=mapq.TypeOfMap();
    709   if (strncmp(sphere_type,mapu.TypeOfMap(),4) != 0)
     708  string sphere_type=mapq.TypeOfMap();
     709  if (sphere_type != mapu.TypeOfMap())
    710710    {
    711711      cout <<  " SphericalTransformServer: les deux spheres ne sont pas de meme type" << endl;
     
    715715     
    716716    }
    717   if (strncmp(sphere_type,"RING",4) == 0)
     717  if (sphere_type.substr(0,4) == "RING")
    718718    {
    719719      nsmax=mapq.SizeIndex();
     
    724724    // en vue de l'application du critere Healpix : nlmax<=3*nsmax-1
    725725    // c'est approximatif ; a raffiner.
    726     if (strncmp(sphere_type,"TETAFI",6) == 0)
     726    if (sphere_type.substr(0,6) == "TETAFI")
    727727      {
    728728        nsmax=(int_4)sqrt(mapq.NbPixels()/12.);
     
    739739    {
    740740      cout << "GenerateFromAlm: nlmax should be <= 3*nside-1" << endl;
    741       if (strncmp(sphere_type,"TETAFI",6) == 0)
     741      if (sphere_type.substr(0,6) == "TETAFI")
    742742        {
    743743          cout << " (for this criterium, nsmax is computed as sqrt(nbPixels/12))" << endl;
     
    877877  TVector<int_4> pixNumber;
    878878
    879   char* sphere_type=mapq.TypeOfMap();
    880   if (strncmp(sphere_type,mapu.TypeOfMap(),4) != 0)
     879  string sphere_type=mapq.TypeOfMap();
     880  if (sphere_type != mapu.TypeOfMap())
    881881    {
    882882      cout <<  " SphericalTransformServer: les deux spheres ne sont pas de meme type" << endl;
Note: See TracChangeset for help on using the changeset viewer.