Changeset 1240 in Sophya for trunk/SophyaProg/Tests/obj_fits.cc


Ignore:
Timestamp:
Oct 18, 2000, 10:59:12 PM (25 years ago)
Author:
ansari
Message:

Programme test FITS , Reza 18/10/2000

File:
1 edited

Legend:

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

    r1232 r1240  
    1616{
    1717  if (narg < 3) {
    18     cout << "obj_fits/Erreur arg - Usage obj_fits r/w fitsfilename \n" << endl;
    19     cout << "  w : Create a FITS file with a matrix and an NTuple \n" << endl;
    20     cout << "  r : Read a matrix and an NTuple from a Fits File \n" << endl;
     18    cout << "obj_fits/Erreur arg - Usage obj_fits r/r2/w/w2 fitsfilename " << endl;
     19    cout << "  w : Create a FITS file with a matrix and an NTuple " << endl;
     20    cout << "  r : Read a matrix and an NTuple from a Fits File " << endl;
     21    cout << "  2 : Image on secondary header " << endl; 
    2122    exit(1);
    2223  }
     
    2425    SophyaInit();
    2526    string flnm = arg[2];
     27    bool imgonph = true;
     28    if (*(arg[1]+1) == '2')  imgonph = false;
    2629    if (*arg[1] == 'r') {
    2730      cout << " obj_fits/Info: Opening input FitsFile " << endl;
    2831      FitsInFile fiis(flnm);
     32      fiis.firstImageOnPrimaryHeader(imgonph);
     33
    2934      cout << " Reading Matrix m from FITS " << endl;
    30       Matrix m(1,1);
     35      Matrix m;
    3136      fiis >> m;
    3237      cout << m << endl;
     
    4045      cout << " obj_fits/Info: Opening output FitsFile " << endl;
    4146      FitsOutFile fios(flnm);
    42       fios.firstImageOnPrimaryHeader();
     47      fios.firstImageOnPrimaryHeader(imgonph);
     48
    4349      cout << " Creating Matrix m " << endl;
    4450      Matrix m(50,70);
    4551      m = RegularSequence(35., 0.2);
     52      m.Info()["SVERSION"] = SophyaVersion();
     53      m.Info().SetComment("SVERSIO", "Sophya Version");
     54      m.Info()["OBJ_FITS"] = "Test Matrix" ;
    4655      cout << m << endl;
    4756     
Note: See TracChangeset for help on using the changeset viewer.