Changeset 606 in Sophya for trunk/SophyaProg/Tests/tspm2.cc


Ignore:
Timestamp:
Nov 20, 1999, 9:47:42 PM (26 years ago)
Author:
ansari
Message:

Amelioration test spheres - Reza 20/11/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/tspm2.cc

    r591 r606  
    5858  printf("Xsize= %d   Ysize= %d  NPix= %d\n",img.XSize(),img.YSize(),img.XSize()*img.YSize() );
    5959  n = 0;
     60  img.Zero();
    6061  for(j=0; j<img.YSize(); j++) {
    6162    yd = (r_4)(j+0.5)/(r_4)img.YSize()-0.5;
     
    112113   nomobj = "sphg1";
    113114   fiog.Write(s, nomobj);
    114    cout << "SphMap written to POutPersist with name "  << nomobj << endl;
    115    }
    116 
     115   cout << "SphMap SphereGorski<double> written to POutPersist with name "  << nomobj << endl;
     116   }
     117
     118  FitsIoServer fios;
    117119  // On projete dans un fichier FITS
    118   FitsIoServer fios;
    119120  fios.sinus_picture_projection(sph, "gsin1.fits");
    120121  fios.save(sph, "sph1.fits");
     
    146147  PrtTim("End of Mean-Sig ");
    147148  }
     149
    148150  {
    149   SphereGorski<double> sph(m);
     151  SphereGorski<float> sph(m);
    150152
    151153  cout << "Filling spherical map2 NPixels= " << sph.NbPixels() << endl;
     
    164166
    165167   {
    166    FIO_SphereGorski<double> fiog(&sph) ;
     168   FIO_SphereGorski<float> fiog(&sph) ;
    167169   nomobj = "sphg2";
    168170   fiog.Write(s, nomobj);
    169    cout << "SphMap written to POutPersist with name "  << nomobj << endl;
     171   cout << "SphMap SphereGorski<float> written to POutPersist with name "  << nomobj << endl;
    170172   }
    171173
     
    173175  // On projete dans un fichier FITS
    174176  FitsIoServer fios;
     177   {
     178   cout << "Test of Write/Read SphereGorski<float> to FITS (sphg_r4.fits) " << endl;
     179   fios.save(sph, "sphg_r4.fits");
     180 
     181   SphereGorski<float> sphr(4);
     182   fios.load(sphr, "sphg_r4.fits", 2);
     183   cout << " Read from file - SphereGorski<float> NPixels= " << sphr.NbPixels() << endl;
     184   int ndiff = 0;
     185   for(int k=0; k<sphr.NbPixels(); k++) {
     186    if ( sphr(k) != sph(k) )   {
     187      ndiff++;
     188      if (ndiff < 20)  cout << "!!!Diff: K= " << k << " SPHR= " << sphr(k) << " SPH= " << sph(k) << endl;
     189      }
     190    }
     191   cout << " ReadFrom FITS NDiff = " << ndiff << " (should be zero = 0) " << endl;
     192   
     193   }
     194
     195
    175196  fios.sinus_picture_projection(sph, "gsin2.fits");
    176197  fios.save(sph, "sph2.fits");
    177198
    178   TMatrix<double> mtx(3*m, 6*m);
     199  TMatrix<float> mtx(3*m, 6*m);
    179200  Project_Mol(sph, mtx);
    180201  fios.save(mtx, "mtx2.fits");
Note: See TracChangeset for help on using the changeset viewer.