Ignore:
Timestamp:
Oct 2, 2011, 8:25:23 PM (14 years ago)
Author:
cmv
Message:

bintable avec elements vecteur, cmv 02/10/2011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fabtwriter.cc

    r3668 r4023  
    532532  \param col : column number [0,ncol[
    533533  \param row : row number    [0,nrow[
     534  \param nfirstel : element number    [0,repeat[
    534535  \param val : value to be written
    535536  \warning that routine write a SHORT value into column "col"
     
    539540  WARNING: suppose that the column has be defined to be TSHORT
    540541           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 and
     542   - If you write dummy.Write(col,row,nfirstel,(short)(val))
     543       the Write(int,long,long,short) routine is called and
    543544       the cast is performed by the C++ language.
    544    - If you write dummy.Write(col,row,val) where val is double
    545        the Write(int,long,double) routine is called and
     545   - If you write dummy.Write(col,row,nfirstel,val) where val is double
     546       the Write(int,long,long,double) routine is called and
    546547       the cast is performed by the cfistio package.
    547548  \endverbatim
     
    549550
    550551/*! Write signed char (1 Byte) data to FITS file (see below) */
    551 void FitsABTWriter::Write(int col,LONGLONG row,int_1 val)
     552void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_1 val)
    552553{
    553554#ifdef TSBYTE
    554555  if(FirstTime) createtbl();
    555556  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))
    557558    printerrorwrite("signed char",col,row,sta);
    558559#else
     
    562563
    563564/*! 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))
     565void 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))
    569570    printerrorwrite("unsigned char",col,row,sta);
    570571}
    571572
    572573/*! 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))
     574void 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))
    578579    printerrorwrite("short",col,row,sta);
    579580}
    580581
    581582/*! 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))
     583void 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))
    587588    printerrorwrite("unsigned short",col,row,sta);
    588589}
    589590
    590591/*! Write long (4 Bytes) data to FITS file (see below) */
    591 void FitsABTWriter::Write(int col,LONGLONG row,int_4 val)
     592void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_4 val)
    592593{
    593594  if(FirstTime) createtbl();
     
    595596  // Bug ou inconsistence cfitsio sur machine ou long=8Bytes ?
    596597  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))
    598599    printerrorwrite("long",col,row,sta);
    599600}
    600601
    601602/*! Write unsigned long (4 Bytes) data to FITS file (see below) */
    602 void FitsABTWriter::Write(int col,LONGLONG row,uint_4 val)
     603void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,uint_4 val)
    603604{
    604605  if(FirstTime) createtbl();
     
    606607  // Bug ou inconsistence cfitsio sur machine ou long=8Bytes ?
    607608  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))
    609610    printerrorwrite("long",col,row,sta);
    610611}
    611612
    612613/*! Write long long (8 Bytes) data to FITS file (see below) */
    613 void FitsABTWriter::Write(int col,LONGLONG row,int_8 val)
     614void FitsABTWriter::Write(int col,LONGLONG row,long nfirstel,int_8 val)
    614615{
    615616#ifdef TLONGLONG
    616617  if(FirstTime) createtbl();
    617618  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))
    619620    printerrorwrite("long long",col,row,sta);
    620621#else
     
    624625
    625626/*! 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))
     627void 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))
    631632    printerrorwrite("float",col,row,sta);
    632633}
    633634
    634635/*! 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))
     636void 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))
    640641    printerrorwrite("double",col,row,sta);
    641642}
     
    649650  \return "N" = number of the next row to be written,
    650651      that is "N-1" is the number of the last row written.
     652  \warning : be carefull if "repeat" not egal to 1
    651653*/
    652654
Note: See TracChangeset for help on using the changeset viewer.