Changeset 2858 in Sophya for trunk/SophyaProg
- Timestamp:
- Dec 13, 2005, 9:17:38 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/tswfits.cc
r2783 r2858 7 7 #include "histinit.h" 8 8 #include "dvlist.h" 9 #include "datatable.h" 10 #include "swppfdtable.h" 11 #include "fabtwriter.h" 12 #include "fabtcolread.h" 9 // #include "datatable.h" 10 // #include "swppfdtable.h" 13 11 #include "fitsswapper.h" 14 12 … … 28 26 } 29 27 catch(PThrowable exc ) { 30 cerr << "t nt-main() , Catched exception: \n" << exc.Msg() << endl;28 cerr << "tswfits-main() , Catched exception: \n" << exc.Msg() << endl; 31 29 } 32 30 catch(std::exception ex) { 33 cerr << "t nt-main() , Catched exception ! " << (string)(ex.what()) << endl;31 cerr << "tswfits-main() , Catched exception ! " << (string)(ex.what()) << endl; 34 32 } 35 33 catch(...) { 36 cerr << "t nt-main() , Catched ... ! " << endl;34 cerr << "tswfits-main() , Catched ... ! " << endl; 37 35 } 38 36 } … … 46 44 { 47 45 cout << " Creation FITSDataSwapper<double> swout(so) avec swseg.fits " << endl; 48 FitsABTWriter so("!swseg.fits", BINARY_TBL, 0); 49 so.SetExtName("SwapMyExt"); 50 int col = so.AddCol("SwapColD", NULL, "unit1", TDOUBLE); 51 so.Write(col, 0, 88888); 52 so.Print(); 46 vector<string> ttype, tform, tunit; 47 ttype.push_back("D-Col1"); 48 tform.push_back("D"); 49 tunit.push_back(""); 50 // ttype.push_back("I-Col2"); 51 // tform.push_back("J"); 52 // tunit.push_back(""); 53 string tblnm = "SwapMyExt"; 54 FitsInOutFile fiosc("!swseg.fits", FitsInOutFile::Fits_Create); 55 // fiosc.MoveAbsToHDU(2); 56 cout << " DBG-Appel CreateTable ... " << endl; 57 fiosc.CreateTable(BINARY_TBL, "rzbintbl", ttype, tform, tunit); 53 58 cout << " ---- Appel a FITSDataSwapper<double> --- " << endl; 54 FITSDataSwapper<double> swout( so.GetFitsPtr(),0);59 FITSDataSwapper<double> swout(&fiosc, 1); 55 60 SwSegDataBlock<double> swsd(swout, SWSEGSZ, 3); 61 // FITSDataSwapper<int_4> swout(&fiosc, 1); 62 // SwSegDataBlock<int_4> swsd(swout, SWSEGSZ, 3); 56 63 double * fp = swsd.GetSegment(0); 57 64 fp[0] = 6.54321; fp[1] = 65.4321; fp[2] = 654.321; fp[3] = 6543.21; … … 67 74 { 68 75 cout << "6/ Creation PPFDataSwapper<float> avec lecture depuis swseg.ppf " << endl; 69 Fits OpenFile si("swseg.fits");70 si.Move ToFirst(BINARY_TBL);71 FITSDataSwapper<double> swin( si.GetFitsPtr(), 0);76 FitsInOutFile si("swseg.fits", FitsInOutFile::Fits_RO); 77 si.MoveAbsToHDU(2); 78 FITSDataSwapper<double> swin(&si, 1); 72 79 SwSegDataBlock<double> swsd(swin, tags, SWSEGSZ); 73 80 cout <<"7/ Recopie ds SegDataBlock<float> depuis SwSegDataBlock<float> et print" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.