Changeset 2169 in Sophya for trunk/SophyaExt/FitsIOServer
- Timestamp:
- Aug 8, 2002, 7:48:02 PM (23 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.cc
r2087 r2169 466 466 } 467 467 468 /*! idem before but for TVector of int_8 */ 469 long FitsABTColRead::Read(long n1,long n2,TVector<int_8>& data) 470 { 471 #ifdef TLONGLONG 472 if(n1<0 || n1>=NBline) 473 throw RangeCheckError("FitsABTColRead::Read TVector bad requested 1srt line \n"); 474 if(data.Size()<=0 && n2<n1) 475 throw RangeCheckError("FitsABTColRead::Read TVector bad requested 2sd line \n"); 476 if(n2<0) n2 = n1 + data.Size()-1; 477 if(n2>=NBline) n2 = NBline-1; 478 479 sa_size_t nread = n2-n1+1; 480 if(data.Size()<nread) data.SetSize(nread); 481 482 int sta=0; 483 fits_read_col(FitsPtr,TLONGLONG,ColNum+1,n1+1,1,nread,NULL,data.Data(),NULL,&sta); 484 if(sta) { 485 printerror(sta); 486 throw NotAvailableOperation("FitsABTColRead::Read_TVector<float>: Error Reading Fits file\n"); 487 } 488 489 return nread; 490 #else 491 throw PException("FitsABTColRead::Read(..,TVector<int_8>&) Not in that cfitsio version"); 492 #endif 493 } 494 468 495 ///////////////////////////////////////////////// 469 496 /*! -
trunk/SophyaExt/FitsIOServer/fabtcolread.h
r1814 r2169 36 36 long Read(long n1,long n2,TVector<float>& data); 37 37 long Read(long n1,long n2,TVector<int_4>& data); 38 long Read(long n1,long n2,TVector<int_8>& data); 38 39 39 40 //! return the value of the first row -
trunk/SophyaExt/FitsIOServer/fabtwriter.cc
r1822 r2169 179 179 if BINARY_TBL and tform="" or tform=NULL) 180 180 \param tunit : fits tunit definition (optional) 181 \param datatype : TBYTE TSHORT TLONG (TINT32BIT) T FLOAT TDOUBLE181 \param datatype : TBYTE TSHORT TLONG (TINT32BIT) TLONGLONG TFLOAT TDOUBLE 182 182 TUSHORT TULONG. That parameter is only use in case 183 183 of a BINARY_TBL table when tform is not defined). … … 201 201 if(datatype==TBYTE) strcpy(str,"1B"); 202 202 else if(datatype==TSHORT) strcpy(str,"1I"); 203 //CMV$CHECK Commentaire temporaire (il faut au moins cfitsio 2204)204 //else if(datatype==TINT32BIT) strcpy(str,"1J");205 203 else if(datatype==TLONG) strcpy(str,"1J"); 204 #ifdef TINT32BIT 205 else if(datatype==TINT32BIT) strcpy(str,"1J"); 206 #endif 207 #ifdef TLONGLONG 208 else if(datatype==TLONGLONG) strcpy(str,"1K"); 209 #endif 206 210 else if(datatype==TFLOAT) strcpy(str,"1E"); 207 211 else if(datatype==TDOUBLE) strcpy(str,"1D"); … … 310 314 } 311 315 312 /*! Write long data to FITS file (see below) */316 /*! Write long (4 Bytes) data to FITS file (see below) */ 313 317 void FitsABTWriter::Write(int col,long row,int_4 val) 314 318 { … … 319 323 if(fits_write_col(FitsPtr,T,col+1,row+1,1,1,&val,&sta)) 320 324 printerrorwrite("long",col,row,sta); 325 } 326 327 /*! Write long long (8 Bytes) data to FITS file (see below) */ 328 void FitsABTWriter::Write(int col,long row,int_8 val) 329 { 330 #ifdef TLONGLONG 331 if(FirstTime) createtbl(); 332 int sta=0; 333 if(fits_write_col(FitsPtr,TLONGLONG,col+1,row+1,1,1,&val,&sta)) 334 printerrorwrite("long long",col,row,sta); 335 #else 336 throw PException("FitsABTWriter::Write(..,int_8) Not in that cfitsio version"); 337 #endif 321 338 } 322 339 … … 348 365 that is "N-1" is the number of the last row written. 349 366 */ 350 /*! Write a vector of long data to FITS file (see below) */367 /*! Write a vector of long (4 Bytes) data to FITS file (see below) */ 351 368 long FitsABTWriter::Write(int col,long row,TVector<int_4>& val) 352 369 { … … 359 376 printerrorwrite("long",col,row,sta); 360 377 return row+nel; 378 } 379 380 /*! Write a vector of long long (8 Bytes) data to FITS file (see below) */ 381 long FitsABTWriter::Write(int col,long row,TVector<int_8>& val) 382 { 383 #ifdef TLONGLONG 384 if(FirstTime) createtbl(); 385 long nel = val.Size(); 386 int sta=0; 387 if(fits_write_col(FitsPtr,TLONGLONG,col+1,row+1,1,nel,val.Data(),&sta)) 388 printerrorwrite("long long",col,row,sta); 389 return row+nel; 390 #else 391 throw PException("FitsABTWriter::Write(..,TVector<int_8>&) Not in that cfitio version"); 392 #endif 361 393 } 362 394 -
trunk/SophyaExt/FitsIOServer/fabtwriter.h
r1814 r2169 48 48 void Write(int col,long row,short val); 49 49 void Write(int col,long row,int_4 val); 50 void Write(int col,long row,int_8 val); 50 51 void Write(int col,long row,float val); 51 52 void Write(int col,long row,double val); 52 53 long Write(int col,long row,TVector<int_4>& val); 54 long Write(int col,long row,TVector<int_8>& val); 53 55 long Write(int col,long row,TVector<float>& val); 54 56 long Write(int col,long row,TVector<double>& val);
Note:
See TracChangeset
for help on using the changeset viewer.