Changeset 1193 in Sophya for trunk/SophyaExt/FitsIOServer/fitsfile.h
- Timestamp:
- Sep 19, 2000, 5:08:16 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitsfile.h
r1183 r1193 12 12 namespace SOPHYA { 13 13 14 struct BnTblLine 15 { 16 BnTblLine() {} 17 void 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 14 57 class FitsFile; 15 58 class FitsInFile; 16 59 class FitsOutFile; 17 60 enum WriteMode {append, clear, unknown}; 18 61 19 62 … … 88 131 calls the method 'WriteToFits' from the inherited object 89 132 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 93 133 */ 94 void Write(char flnm[] , string WriteMode= string("unknown")) ;134 void Write(char flnm[]) ; 95 135 96 136 /*! … … 106 146 friend class FitsInFile; 107 147 friend class FitsOutFile; 108 148 private : 109 149 }; 110 150 … … 262 302 void GetBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char 263 303 ** cdata) ; 304 /*! 305 get the NoLine-th 'line' from the current BINTABLE extension on FITS file, 306 */ 307 void GetBinTabLine(long NoLine, BnTblLine& ligne) ; 264 308 265 309 /*! … … 358 402 359 403 public: 404 405 360 406 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 ); 362 412 ~FitsOutFile() { ;}; 363 413 inline void InitNull() {imageOnPrimary_=false;} … … 414 464 \param <taille_des_chaines> vector containing the number of characters of data for each char* typed column, with order of appearance in 'fieldType' 415 465 */ 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) ; 417 467 418 468 /*! write double data from array 'donnees ' on column number 'nocol' of a BINTABLE extension. … … 430 480 /*! same as previous method with char* data */ 431 481 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 432 485 433 486 /////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.