Changeset 2858 in Sophya for trunk/SophyaProg


Ignore:
Timestamp:
Dec 13, 2005, 9:17:38 AM (20 years ago)
Author:
ansari
Message:

Adaptation prog test FitsSwapper aux modifs de la classe - Reza 13/12/2005

File:
1 edited

Legend:

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

    r2783 r2858  
    77#include "histinit.h"
    88#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"
    1311#include "fitsswapper.h"
    1412
     
    2826  }
    2927  catch(PThrowable exc ) {
    30     cerr << "tnt-main() , Catched exception: \n" << exc.Msg() << endl;
     28    cerr << "tswfits-main() , Catched exception: \n" << exc.Msg() << endl;
    3129  }
    3230  catch(std::exception ex) {
    33     cerr << "tnt-main() , Catched exception ! " << (string)(ex.what()) << endl;
     31    cerr << "tswfits-main() , Catched exception ! " << (string)(ex.what()) << endl;
    3432  }
    3533  catch(...) {
    36     cerr << "tnt-main() , Catched ... ! " << endl;
     34    cerr << "tswfits-main() , Catched ... ! " << endl;
    3735  }
    3836}
     
    4644    {
    4745      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);
    5358      cout << " ---- Appel a FITSDataSwapper<double> --- " << endl;
    54       FITSDataSwapper<double> swout(so.GetFitsPtr(),0 );
     59      FITSDataSwapper<double> swout(&fiosc, 1);
    5560      SwSegDataBlock<double> swsd(swout, SWSEGSZ, 3);
     61      //      FITSDataSwapper<int_4> swout(&fiosc, 1);
     62      //      SwSegDataBlock<int_4> swsd(swout, SWSEGSZ, 3);
    5663      double * fp = swsd.GetSegment(0);
    5764      fp[0] = 6.54321;   fp[1] = 65.4321;  fp[2] = 654.321;  fp[3] = 6543.21;
     
    6774    {
    6875      cout << "6/ Creation PPFDataSwapper<float> avec lecture depuis swseg.ppf " << endl;
    69       FitsOpenFile si("swseg.fits");
    70       si.MoveToFirst(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);
    7279      SwSegDataBlock<double> swsd(swin, tags, SWSEGSZ);
    7380      cout <<"7/ Recopie ds SegDataBlock<float> depuis SwSegDataBlock<float> et print" << endl;
Note: See TracChangeset for help on using the changeset viewer.