Changeset 1659 in Sophya for trunk/SophyaExt/FitsIOServer/fabtwriter.cc
- Timestamp:
- Sep 28, 2001, 7:22:39 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtwriter.cc
r1658 r1659 10 10 \ingroup FitsIOServer 11 11 Class for writing a FITS ASCII or BINARY table 12 \verbatim\ 13 Exemple: 14 FitsABTWriter fbtw("myfits.fits",BINARY_TBL,3); 12 \verbatim 13 //----------------------------------------------------------- 14 -- Exemple 1: Writing element by element 15 FitsABTWriter fbtw(fitswrit,BINARY_TBL); 15 16 fbtw.SetExtName("MY_OWN_EXTENSION"); 16 17 fbtw.AddCol("vars",TSHORT,"","km"); // col=0 … … 33 34 cout<<"Number of Overflows when writing: " 34 35 <<fbtw.GetNOverFlow()<<endl; 36 37 //----------------------------------------------------------- 38 -- Exemple 2: Writing into TVector 39 ... 40 TVector<double> datad(100); 41 TVector<float> dataf(100); 42 TVector<int_4> datal(100); 43 for(long i=0;i<9990;i+=100) { 44 long i2=i+100-1; if(i2>=9990) i2=9990-1; 45 for(long j=0;j<100;j++) datad(i) = ...; 46 for(long j=0;j<100;j++) dataf(i) = ...; 47 for(long j=0;j<100;j++) datal(i) = ...; 48 fbtw.Write(1,i,datal); 49 fbtw.Write(2,i,dataf); 50 fbtw.Write(3,i,datad); 51 } 35 52 \endverbatim 36 53 */ … … 39 56 /*! 40 57 Constructor. 41 \verbatim 42 fname : FITS file name to be written 43 hdutype : type of extension to be created (BINARY_TBL or ASCII_TBL) 44 lp : debug level 45 \endverbatim 58 \param fname : FITS file name to be written 59 \param hdutype : type of extension to be created (BINARY_TBL or ASCII_TBL) 60 \param lp : debug level 46 61 */ 47 62 FitsABTWriter::FitsABTWriter(string fname,int hdutype,int lp) … … 103 118 /*! 104 119 Add a new column to the FITS table 105 \ verbatim106 label : column label107 datatype : TSHORT TINT32BIT TFLOAT or TDOUBLE108 tform : fits tform definition109 (can be automatically set if BINARY_TBL and tform="")110 tunit : fits tunit definition (optional)111 \ endverbatim120 \param label : column label 121 \param datatype : TSHORT TINT32BIT TFLOAT or TDOUBLE 122 \param tform : fits tform definition 123 (can be automatically set if BINARY_TBL and tform="") 124 \param tunit : fits tunit definition (optional) 125 \return The number of the new added column in the table. 126 \warning col = [0,ncol-1] 112 127 */ 113 128 int FitsABTWriter::addcol(const char* label,int datatype … … 197 212 /*! 198 213 Write a short data to FITS file. 199 \verbatim 200 col : column number [0,ncol[ 201 row : row number [0,nrow[ 202 val : value to be written 203 WARNING: that routine write a SHORT value into column "col" 214 \param col : column number [0,ncol[ 215 \param row : row number [0,nrow[ 216 \param val : value to be written 217 \warning that routine write a SHORT value into column "col" 204 218 which could have been defined with an other type. 205 219 Cast is performed by the cfitsio package. 220 \verbatim 206 221 WARNING: suppose that the column has be defined to be TSHORT 207 222 and suppose that you wanted to write a double value … … 254 269 /*! 255 270 Write a vector of long data to FITS file. 256 \verbatim 257 col : column number [0,ncol[ 258 row : starting row number [0,nrow[ 259 val : vector to be written 260 Return: "N" = number of the next row to be written 261 that is "N-1" is the number of the last row written. 262 \endverbatim 271 \param col : column number [0,ncol[ 272 \param row : starting row number [0,nrow[ 273 \param val : vector to be written 274 \return "N" = number of the next row to be written, 275 that is "N-1" is the number of the last row written. 263 276 */ 264 277 /*! Write a vector of long data to FITS file (see below) */
Note:
See TracChangeset
for help on using the changeset viewer.