Changeset 2174 in Sophya


Ignore:
Timestamp:
Aug 9, 2002, 10:46:59 PM (23 years ago)
Author:
cmv
Message:

gestion defaut ASCII table cmv 9/8/02

Location:
trunk/SophyaExt/FitsIOServer
Files:
3 edited

Legend:

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

    r2173 r2174  
    215215
    216216 // Get column name back, tunit, tform
    217  char tunit[64], tform[64];
     217 char tunit[64], tform[64], tdisp[64];
    218218 long repeat=0; double tscale=1., tzero=0.;
    219219 int rc=0;
    220220 if(HduType==BINARY_TBL) {
    221221   fits_get_bcolparms(FitsPtr,ColNum+1,labelcol,tunit,tform
    222                      ,&repeat,&tscale,&tzero,NULL,NULL,&sta);
     222                     ,&repeat,&tscale,&tzero,NULL,tdisp,&sta);
    223223 } else {
    224224   fits_get_acolparms(FitsPtr,ColNum+1,labelcol,&repeat,tunit,tform
    225                      ,&tscale,&tzero,NULL,NULL,&sta);
     225                     ,&tscale,&tzero,NULL,tdisp,&sta);
    226226 }
    227227 if(rc) {
     
    237237       <<" TypeCode="<<ColTypeCode<<" TUnit="<<ColTUnit<<" TForm="<<ColTForm<<endl;
    238238 if(DbgLevel>1)
    239    cout<<"      (repeat="<<repeat<<",tscale="<<tscale<<",tzero="<<tzero<<")"<<endl;
     239   cout<<"      (repeat="<<repeat<<",tscale="<<tscale<<",tzero="<<tzero
     240       <<",tdisp="<<tdisp<<")"<<endl;
    240241
    241242}
  • trunk/SophyaExt/FitsIOServer/fabtwriter.cc

    r2173 r2174  
    193193 // Gestion auto du tform pour les tables binaires avec le datatype (si non-definie)
    194194 bool tformauto = false;
    195  if(HduType==BINARY_TBL) {
     195 if(HduType==BINARY_TBL || HduType==ASCII_TBL) {
    196196   if(tform==NULL)           tformauto = true;
    197197   else if(strlen(tform)<=0) tformauto = true;
    198198 }
    199  if(tformauto) {
     199 if(tformauto && HduType==BINARY_TBL) {
    200200   char str[8];
    201201   if(datatype==TBYTE)          strcpy(str,"1B");
     
    212212   else if(datatype==TUSHORT)   strcpy(str,"1U");
    213213   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");
    214232   else
    215233     throw ParmError("FitsABTWriter::addcol: datatype not allowed\n");
     
    307325*/
    308326
    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) */
     328void FitsABTWriter::Write(int col,long row,uint_1 val)
    311329{
    312330  if(FirstTime) createtbl();
    313331  int sta=0;
    314332  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);
    316334}
    317335
  • trunk/SophyaExt/FitsIOServer/fabtwriter.h

    r2173 r2174  
    4646  inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
    4747
    48   void Write(int col,long row,int_1 val);
     48  void Write(int col,long row,uint_1 val);
    4949  void Write(int col,long row,int_2 val);
    5050  void Write(int col,long row,uint_2 val);
Note: See TracChangeset for help on using the changeset viewer.