Changeset 2174 in Sophya
- Timestamp:
- Aug 9, 2002, 10:46:59 PM (23 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.cc
r2173 r2174 215 215 216 216 // Get column name back, tunit, tform 217 char tunit[64], tform[64] ;217 char tunit[64], tform[64], tdisp[64]; 218 218 long repeat=0; double tscale=1., tzero=0.; 219 219 int rc=0; 220 220 if(HduType==BINARY_TBL) { 221 221 fits_get_bcolparms(FitsPtr,ColNum+1,labelcol,tunit,tform 222 ,&repeat,&tscale,&tzero,NULL, NULL,&sta);222 ,&repeat,&tscale,&tzero,NULL,tdisp,&sta); 223 223 } else { 224 224 fits_get_acolparms(FitsPtr,ColNum+1,labelcol,&repeat,tunit,tform 225 ,&tscale,&tzero,NULL, NULL,&sta);225 ,&tscale,&tzero,NULL,tdisp,&sta); 226 226 } 227 227 if(rc) { … … 237 237 <<" TypeCode="<<ColTypeCode<<" TUnit="<<ColTUnit<<" TForm="<<ColTForm<<endl; 238 238 if(DbgLevel>1) 239 cout<<" (repeat="<<repeat<<",tscale="<<tscale<<",tzero="<<tzero<<")"<<endl; 239 cout<<" (repeat="<<repeat<<",tscale="<<tscale<<",tzero="<<tzero 240 <<",tdisp="<<tdisp<<")"<<endl; 240 241 241 242 } -
trunk/SophyaExt/FitsIOServer/fabtwriter.cc
r2173 r2174 193 193 // Gestion auto du tform pour les tables binaires avec le datatype (si non-definie) 194 194 bool tformauto = false; 195 if(HduType==BINARY_TBL ) {195 if(HduType==BINARY_TBL || HduType==ASCII_TBL) { 196 196 if(tform==NULL) tformauto = true; 197 197 else if(strlen(tform)<=0) tformauto = true; 198 198 } 199 if(tformauto ) {199 if(tformauto && HduType==BINARY_TBL) { 200 200 char str[8]; 201 201 if(datatype==TBYTE) strcpy(str,"1B"); … … 212 212 else if(datatype==TUSHORT) strcpy(str,"1U"); 213 213 else if(datatype==TULONG) strcpy(str,"1V"); 214 else 215 throw ParmError("FitsABTWriter::addcol: datatype not allowed\n"); 216 TForm.push_back(str); 217 } else if(tformauto && HduType==ASCII_TBL) { 218 char str[8]; 219 if(datatype==TBYTE) strcpy(str,"I5"); 220 else if(datatype==TSHORT) strcpy(str,"I7"); 221 else if(datatype==TLONG) strcpy(str,"I11"); 222 #ifdef TINT32BIT 223 else if(datatype==TINT32BIT) strcpy(str,"I11"); 224 #endif 225 #ifdef TLONGLONG 226 else if(datatype==TLONGLONG) strcpy(str,"I21"); 227 #endif 228 else if(datatype==TFLOAT) strcpy(str,"E29.20"); 229 else if(datatype==TDOUBLE) strcpy(str,"E29.20"); 230 else if(datatype==TUSHORT) strcpy(str,"I7"); 231 else if(datatype==TULONG) strcpy(str,"I11"); 214 232 else 215 233 throw ParmError("FitsABTWriter::addcol: datatype not allowed\n"); … … 307 325 */ 308 326 309 /*! Write signed char (1 Byte) data to FITS file (see below) */310 void FitsABTWriter::Write(int col,long row, int_1 val)327 /*! Write unsigned char (1 Byte) data to FITS file (see below) */ 328 void FitsABTWriter::Write(int col,long row,uint_1 val) 311 329 { 312 330 if(FirstTime) createtbl(); 313 331 int sta=0; 314 332 if(fits_write_col(FitsPtr,TBYTE,col+1,row+1,1,1,&val,&sta)) 315 printerrorwrite(" char",col,row,sta);333 printerrorwrite("unsigned char",col,row,sta); 316 334 } 317 335 -
trunk/SophyaExt/FitsIOServer/fabtwriter.h
r2173 r2174 46 46 inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;} 47 47 48 void Write(int col,long row, int_1 val);48 void Write(int col,long row,uint_1 val); 49 49 void Write(int col,long row,int_2 val); 50 50 void Write(int col,long row,uint_2 val);
Note:
See TracChangeset
for help on using the changeset viewer.