Changeset 4023 in Sophya for trunk/SophyaExt/FitsIOServer/fabtwriter.cc
- Timestamp:
- Oct 2, 2011, 8:25:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtwriter.cc
r3668 r4023 532 532 \param col : column number [0,ncol[ 533 533 \param row : row number [0,nrow[ 534 \param nfirstel : element number [0,repeat[ 534 535 \param val : value to be written 535 536 \warning that routine write a SHORT value into column "col" … … 539 540 WARNING: suppose that the column has be defined to be TSHORT 540 541 and suppose that you wanted to write a double value "val" 541 - If you write dummy.Write(col,row, (short)(val))542 the Write(int,long, short) routine is called and542 - If you write dummy.Write(col,row,nfirstel,(short)(val)) 543 the Write(int,long,long,short) routine is called and 543 544 the cast is performed by the C++ language. 544 - If you write dummy.Write(col,row, val) where val is double545 the Write(int,long, double) routine is called and545 - If you write dummy.Write(col,row,nfirstel,val) where val is double 546 the Write(int,long,long,double) routine is called and 546 547 the cast is performed by the cfistio package. 547 548 \endverbatim … … 549 550 550 551 /*! Write signed char (1 Byte) data to FITS file (see below) */ 551 void FitsABTWriter::Write(int col,LONGLONG row, int_1 val)552 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_1 val) 552 553 { 553 554 #ifdef TSBYTE 554 555 if(FirstTime) createtbl(); 555 556 int sta=0; 556 if(fits_write_col(FitsPtr,TSBYTE,col+1,row+1, 1,1,&val,&sta))557 if(fits_write_col(FitsPtr,TSBYTE,col+1,row+1,nfirstel+1,1,&val,&sta)) 557 558 printerrorwrite("signed char",col,row,sta); 558 559 #else … … 562 563 563 564 /*! Write unsigned char (1 Byte) data to FITS file (see below) */ 564 void FitsABTWriter::Write(int col,LONGLONG row, uint_1 val)565 { 566 if(FirstTime) createtbl(); 567 int sta=0; 568 if(fits_write_col(FitsPtr,TBYTE,col+1,row+1, 1,1,&val,&sta))565 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,uint_1 val) 566 { 567 if(FirstTime) createtbl(); 568 int sta=0; 569 if(fits_write_col(FitsPtr,TBYTE,col+1,row+1,nfirstel+1,1,&val,&sta)) 569 570 printerrorwrite("unsigned char",col,row,sta); 570 571 } 571 572 572 573 /*! Write short (2 Bytes) data to FITS file (see below) */ 573 void FitsABTWriter::Write(int col,LONGLONG row, int_2 val)574 { 575 if(FirstTime) createtbl(); 576 int sta=0; 577 if(fits_write_col(FitsPtr,TSHORT,col+1,row+1, 1,1,&val,&sta))574 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_2 val) 575 { 576 if(FirstTime) createtbl(); 577 int sta=0; 578 if(fits_write_col(FitsPtr,TSHORT,col+1,row+1,nfirstel+1,1,&val,&sta)) 578 579 printerrorwrite("short",col,row,sta); 579 580 } 580 581 581 582 /*! Write unsigned short (2 Bytes) data to FITS file (see below) */ 582 void FitsABTWriter::Write(int col,LONGLONG row, uint_2 val)583 { 584 if(FirstTime) createtbl(); 585 int sta=0; 586 if(fits_write_col(FitsPtr,TUSHORT,col+1,row+1, 1,1,&val,&sta))583 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,uint_2 val) 584 { 585 if(FirstTime) createtbl(); 586 int sta=0; 587 if(fits_write_col(FitsPtr,TUSHORT,col+1,row+1,nfirstel+1,1,&val,&sta)) 587 588 printerrorwrite("unsigned short",col,row,sta); 588 589 } 589 590 590 591 /*! Write long (4 Bytes) data to FITS file (see below) */ 591 void FitsABTWriter::Write(int col,LONGLONG row, int_4 val)592 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_4 val) 592 593 { 593 594 if(FirstTime) createtbl(); … … 595 596 // Bug ou inconsistence cfitsio sur machine ou long=8Bytes ? 596 597 int T = (sizeof(long)==4) ? TLONG: TINT; 597 if(fits_write_col(FitsPtr,T,col+1,row+1, 1,1,&val,&sta))598 if(fits_write_col(FitsPtr,T,col+1,row+1,nfirstel+1,1,&val,&sta)) 598 599 printerrorwrite("long",col,row,sta); 599 600 } 600 601 601 602 /*! Write unsigned long (4 Bytes) data to FITS file (see below) */ 602 void FitsABTWriter::Write(int col,LONGLONG row, uint_4 val)603 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,uint_4 val) 603 604 { 604 605 if(FirstTime) createtbl(); … … 606 607 // Bug ou inconsistence cfitsio sur machine ou long=8Bytes ? 607 608 int T = (sizeof(unsigned long)==4) ? TULONG: TUINT; 608 if(fits_write_col(FitsPtr,T,col+1,row+1, 1,1,&val,&sta))609 if(fits_write_col(FitsPtr,T,col+1,row+1,nfirstel+1,1,&val,&sta)) 609 610 printerrorwrite("long",col,row,sta); 610 611 } 611 612 612 613 /*! Write long long (8 Bytes) data to FITS file (see below) */ 613 void FitsABTWriter::Write(int col,LONGLONG row, int_8 val)614 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_8 val) 614 615 { 615 616 #ifdef TLONGLONG 616 617 if(FirstTime) createtbl(); 617 618 int sta=0; 618 if(fits_write_col(FitsPtr,TLONGLONG,col+1,row+1, 1,1,&val,&sta))619 if(fits_write_col(FitsPtr,TLONGLONG,col+1,row+1,nfirstel+1,1,&val,&sta)) 619 620 printerrorwrite("long long",col,row,sta); 620 621 #else … … 624 625 625 626 /*! Write float data to FITS file (see below) */ 626 void FitsABTWriter::Write(int col,LONGLONG row, float val)627 { 628 if(FirstTime) createtbl(); 629 int sta=0; 630 if(fits_write_col(FitsPtr,TFLOAT,col+1,row+1, 1,1,&val,&sta))627 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,float val) 628 { 629 if(FirstTime) createtbl(); 630 int sta=0; 631 if(fits_write_col(FitsPtr,TFLOAT,col+1,row+1,nfirstel+1,1,&val,&sta)) 631 632 printerrorwrite("float",col,row,sta); 632 633 } 633 634 634 635 /*! Write double data to FITS file (see below) */ 635 void FitsABTWriter::Write(int col,LONGLONG row, double val)636 { 637 if(FirstTime) createtbl(); 638 int sta=0; 639 if(fits_write_col(FitsPtr,TDOUBLE,col+1,row+1, 1,1,&val,&sta))636 void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,double val) 637 { 638 if(FirstTime) createtbl(); 639 int sta=0; 640 if(fits_write_col(FitsPtr,TDOUBLE,col+1,row+1,nfirstel+1,1,&val,&sta)) 640 641 printerrorwrite("double",col,row,sta); 641 642 } … … 649 650 \return "N" = number of the next row to be written, 650 651 that is "N-1" is the number of the last row written. 652 \warning : be carefull if "repeat" not egal to 1 651 653 */ 652 654
Note:
See TracChangeset
for help on using the changeset viewer.