Changeset 2170 in Sophya for trunk/SophyaExt/FitsIOServer/fabtcolread.cc
- Timestamp:
- Aug 9, 2002, 3:03:41 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.cc
r2169 r2170 203 203 204 204 // Get column type 205 int ColTypeCode;206 205 if(fits_get_coltype(FitsPtr,ColNum+1,&ColTypeCode,NULL,NULL,&sta)) { 207 206 printerror(sta); Delete(); … … 441 440 } 442 441 443 /*! idem before but for TVector of int_4*/444 long FitsABTColRead::Read(long n1,long n2,TVector< int_4>& data)442 /*! idem before but for TVector of unsigned short */ 443 long FitsABTColRead::Read(long n1,long n2,TVector<uint_2>& data) 445 444 { 446 445 if(n1<0 || n1>=NBline) … … 454 453 if(data.Size()<nread) data.SetSize(nread); 455 454 455 int sta=0; 456 fits_read_col(FitsPtr,TUSHORT,ColNum+1,n1+1,1,nread,NULL,data.Data(),NULL,&sta); 457 if(sta) { 458 printerror(sta); 459 throw NotAvailableOperation("FitsABTColRead::Read_TVector<uint_2>: Error Reading Fits file\n"); 460 } 461 462 return nread; 463 } 464 465 /*! idem before but for TVector of int_4 */ 466 long FitsABTColRead::Read(long n1,long n2,TVector<int_4>& data) 467 { 468 if(n1<0 || n1>=NBline) 469 throw RangeCheckError("FitsABTColRead::Read TVector bad requested 1srt line \n"); 470 if(data.Size()<=0 && n2<n1) 471 throw RangeCheckError("FitsABTColRead::Read TVector bad requested 2sd line \n"); 472 if(n2<0) n2 = n1 + data.Size()-1; 473 if(n2>=NBline) n2 = NBline-1; 474 475 sa_size_t nread = n2-n1+1; 476 if(data.Size()<nread) data.SetSize(nread); 477 456 478 //for(long i=n1;i<=n2;i++) data(i-n1) = Read(i); 457 479 int sta=0; … … 460 482 if(sta) { 461 483 printerror(sta); 462 throw NotAvailableOperation("FitsABTColRead::Read_TVector< float>: Error Reading Fits file\n");484 throw NotAvailableOperation("FitsABTColRead::Read_TVector<int_4>: Error Reading Fits file\n"); 463 485 } 464 486 … … 484 506 if(sta) { 485 507 printerror(sta); 486 throw NotAvailableOperation("FitsABTColRead::Read_TVector< float>: Error Reading Fits file\n");508 throw NotAvailableOperation("FitsABTColRead::Read_TVector<int_8>: Error Reading Fits file\n"); 487 509 } 488 510
Note:
See TracChangeset
for help on using the changeset viewer.