Ignore:
Timestamp:
Sep 19, 2000, 5:08:16 PM (25 years ago)
Author:
ansari
Message:

amelioration lecture ligne a ligne

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitsfile.h

    r1183 r1193  
    1212namespace SOPHYA {
    1313
     14struct BnTblLine
     15 {
     16BnTblLine() {}
     17void setFormat(int dc, int fc, int ic, int cc, vector<string> names)
     18   {
     19    int nbcols = dc + fc + ic + cc;
     20    ColName_ = vector<string>(nbcols);
     21     for (int k=0; k < nbcols; k++) ColName_ = names;
     22    if (dc >0) ddata_ = vector<double>(dc);
     23    if (fc >0) fdata_ = vector<float>(fc);
     24    if (ic >0) idata_ = vector<int>(fc);
     25    if (cc >0) cdata_ = vector<string>(fc);
     26   }
     27   void Print()
     28   {
     29     int k;
     30     int compt = 0;
     31     cout << " ********* ligne ************* " << endl;
     32     cout << " *** noms de variables  " << endl;
     33     for (k=0; k < compt + ColName_.size(); k++) cout << ColName_[k] << " ";
     34     cout << endl;
     35     cout << " *** variables doubles  " << endl;
     36     for (k=0; k < ddata_.size(); k++) cout << ddata_[k] << " ";
     37     cout << endl;
     38     cout << " *** variables float  " << endl;
     39     for (k=0; k < fdata_.size(); k++) cout << fdata_[k] << " ";
     40     cout << endl;
     41     cout << " *** variables int  " << endl;
     42     for (k=0; k < idata_.size(); k++) cout << idata_[k] << " ";
     43     cout << endl;
     44     cout << " *** variables string  " << endl;
     45     for (k=0; k < cdata_.size(); k++) cout << cdata_[k] << " ";
     46     cout << endl;
     47     cout << " ***************************** " << endl;
     48   }
     49  vector<double> ddata_;
     50  vector<float>  fdata_;
     51  vector<int>    idata_;
     52  vector<string>  cdata_;
     53  vector<string> ColName_;
     54
     55 };
     56
    1457 class FitsFile;
    1558 class FitsInFile;
    1659 class FitsOutFile;
    17 
     60 enum WriteMode {append, clear, unknown};
    1861
    1962
     
    88131calls the method 'WriteToFits' from the inherited  object
    89132
    90 \param <WriteMode>  string , WriteMode = "clear" -> if alreadyy exists, the file will be overwrited (else created) ; WriteMode = "append" -> further objects will be appended to the file if it exists (else : file created). Otherwise, file created if does not exist, else : exception. (the last situation is the default)
    91 
    92 
    93133*/
    94   void   Write(char flnm[], string WriteMode= string("unknown")) ;
     134  void   Write(char flnm[]) ;
    95135
    96136  /*!
     
    106146  friend class FitsInFile;
    107147  friend class FitsOutFile;
    108 
     148  private :
    109149  };
    110150
     
    262302  void GetBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char
    263303** cdata) ;
     304  /*!
     305get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
     306  */
     307  void GetBinTabLine(long NoLine, BnTblLine& ligne) ;
    264308
    265309  /*!
     
    358402
    359403 public:
     404
     405
    360406   FitsOutFile();
    361    FitsOutFile(char flnm[], string WriteMode= string("unknown"));
     407   /*!
     408\param <WriteMode>  enum , WriteMode = clear -> if alreadyy exists, the file will be overwritten (else created) ; WriteMode = append -> further objects will be appended to the file if it exists (else : file created). WriteMode = unknown -> file created if does not exist, else : exception. (the last situation is the default)
     409
     410   */
     411   FitsOutFile(char flnm[], WriteMode wrm = unknown );
    362412   ~FitsOutFile() { ;};
    363413   inline void InitNull() {imageOnPrimary_=false;}
     
    414464\param <taille_des_chaines> vector containing the number of characters of  data  for each char* typed column, with order of appearance in 'fieldType'
    415465   */
    416   void makeHeaderBntblOnFits ( char* fieldType, char** Noms, int nentries, int tfields, DVList &dvl, char* extname,  vector<int> taille_des_chaines) ;
     466   void makeHeaderBntblOnFits ( string fieldType, vector<string> Noms, int nentries, int tfields, DVList &dvl, string extname,  vector<int> taille_des_chaines) ;
    417467
    418468  /*! write double data from array 'donnees ' on column number 'nocol' of a BINTABLE  extension.
     
    430480  /*! same as previous method with char* data */
    431481  void putColToFits(int nocol, int nentries, char** donnees) const;
     482
     483  void putBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char ** cdata) const;
     484
    432485
    433486/////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.