Changeset 2169 in Sophya


Ignore:
Timestamp:
Aug 8, 2002, 7:48:02 PM (23 years ago)
Author:
cmv
Message:

long long gestion cfistio>2.4 (compat <2.4) cmv 8/8/2002

Location:
trunk/SophyaExt/FitsIOServer
Files:
4 edited

Legend:

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

    r2087 r2169  
    466466}
    467467
     468/*! idem before but for TVector of int_8 */
     469long 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
    468495/////////////////////////////////////////////////
    469496/*!
  • trunk/SophyaExt/FitsIOServer/fabtcolread.h

    r1814 r2169  
    3636  long   Read(long n1,long n2,TVector<float>& data);
    3737  long   Read(long n1,long n2,TVector<int_4>& data);
     38  long   Read(long n1,long n2,TVector<int_8>& data);
    3839
    3940  //! return the value of the first row
  • trunk/SophyaExt/FitsIOServer/fabtwriter.cc

    r1822 r2169  
    179179          if BINARY_TBL and tform="" or tform=NULL)
    180180  \param tunit : fits tunit definition (optional)
    181   \param datatype : TBYTE TSHORT TLONG (TINT32BIT) TFLOAT TDOUBLE
     181  \param datatype : TBYTE TSHORT TLONG (TINT32BIT) TLONGLONG TFLOAT TDOUBLE
    182182                    TUSHORT TULONG. That parameter is only use in case
    183183                    of a BINARY_TBL table when tform is not defined).
     
    201201   if(datatype==TBYTE)          strcpy(str,"1B");
    202202   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");
    205203   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
    206210   else if(datatype==TFLOAT)    strcpy(str,"1E");
    207211   else if(datatype==TDOUBLE)   strcpy(str,"1D");
     
    310314}
    311315
    312 /*! Write long data to FITS file (see below) */
     316/*! Write long (4 Bytes) data to FITS file (see below) */
    313317void FitsABTWriter::Write(int col,long row,int_4 val)
    314318{
     
    319323  if(fits_write_col(FitsPtr,T,col+1,row+1,1,1,&val,&sta))
    320324    printerrorwrite("long",col,row,sta);
     325}
     326
     327/*! Write long long (8 Bytes) data to FITS file (see below) */
     328void 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
    321338}
    322339
     
    348365      that is "N-1" is the number of the last row written.
    349366*/
    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) */
    351368long FitsABTWriter::Write(int col,long row,TVector<int_4>& val)
    352369{
     
    359376    printerrorwrite("long",col,row,sta);
    360377  return row+nel;
     378}
     379
     380/*! Write a vector of long long (8 Bytes) data to FITS file (see below) */
     381long 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
    361393}
    362394
  • trunk/SophyaExt/FitsIOServer/fabtwriter.h

    r1814 r2169  
    4848  void Write(int col,long row,short val);
    4949  void Write(int col,long row,int_4 val);
     50  void Write(int col,long row,int_8 val);
    5051  void Write(int col,long row,float val);
    5152  void Write(int col,long row,double val);
    5253  long Write(int col,long row,TVector<int_4>& val);
     54  long Write(int col,long row,TVector<int_8>& val);
    5355  long Write(int col,long row,TVector<float>& val);
    5456  long Write(int col,long row,TVector<double>& val);
Note: See TracChangeset for help on using the changeset viewer.