Changeset 606 in Sophya for trunk/SophyaProg/Tests/tspm2.cc
- Timestamp:
- Nov 20, 1999, 9:47:42 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/tspm2.cc
r591 r606 58 58 printf("Xsize= %d Ysize= %d NPix= %d\n",img.XSize(),img.YSize(),img.XSize()*img.YSize() ); 59 59 n = 0; 60 img.Zero(); 60 61 for(j=0; j<img.YSize(); j++) { 61 62 yd = (r_4)(j+0.5)/(r_4)img.YSize()-0.5; … … 112 113 nomobj = "sphg1"; 113 114 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; 117 119 // On projete dans un fichier FITS 118 FitsIoServer fios;119 120 fios.sinus_picture_projection(sph, "gsin1.fits"); 120 121 fios.save(sph, "sph1.fits"); … … 146 147 PrtTim("End of Mean-Sig "); 147 148 } 149 148 150 { 149 SphereGorski< double> sph(m);151 SphereGorski<float> sph(m); 150 152 151 153 cout << "Filling spherical map2 NPixels= " << sph.NbPixels() << endl; … … 164 166 165 167 { 166 FIO_SphereGorski< double> fiog(&sph) ;168 FIO_SphereGorski<float> fiog(&sph) ; 167 169 nomobj = "sphg2"; 168 170 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; 170 172 } 171 173 … … 173 175 // On projete dans un fichier FITS 174 176 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 175 196 fios.sinus_picture_projection(sph, "gsin2.fits"); 176 197 fios.save(sph, "sph2.fits"); 177 198 178 TMatrix< double> mtx(3*m, 6*m);199 TMatrix<float> mtx(3*m, 6*m); 179 200 Project_Mol(sph, mtx); 180 201 fios.save(mtx, "mtx2.fits");
Note:
See TracChangeset
for help on using the changeset viewer.