Changeset 4029 in Sophya for trunk


Ignore:
Timestamp:
Oct 22, 2011, 1:15:49 PM (14 years ago)
Author:
cmv
Message:

suppression lecture Bufferisee de FitsABTColRd (inutile: cfitsio gere bufferisation en interne et complication code), cmv 22/10/2011

Location:
trunk
Files:
6 edited

Legend:

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

    r4025 r4029  
    1 /* Lecteur de colonne de table Fits (binaire ou ASCII) avec buffer */
     1/* Lecteur de colonne de table Fits (binaire ou ASCII) */
    22#include "sopnamsp.h"
    33#include "machdefs.h"
     
    307307  \param collabel : label of the column to be read
    308308  \param ihdu : number of the HDU where the column is.
    309   \param blen : read buffer length
    310   \param bsens : buffer reading direction
    311309  \param lp : debug level
    312310  \verbatim
    313311  - if ihdu<=0 first BINARY or ASCII table is taken
    314312  - if ihdu>nhdu ihdu is set to nhdu
    315   - bsens>0    read forward
    316     bsens<0    read backward
    317     bsens==0   read centered
    318313  \endverbatim
    319314  \warning ihdu = [1,nhdu]
    320315*/
    321 FitsABTColRd::FitsABTColRd(FitsOpenFile* fof,string collabel
    322                           ,int ihdu,long blen,long bsens,int lp)
    323 {
    324   Init(fof,collabel.c_str(),-1,ihdu,blen,bsens,lp);
     316FitsABTColRd::FitsABTColRd(FitsOpenFile* fof,string collabel,int ihdu,int lp)
     317{
     318  Init(fof,collabel.c_str(),-1,ihdu,lp);
    325319}
    326320
     
    331325  \warning col = [0,ncol[
    332326*/
    333 FitsABTColRd::FitsABTColRd(FitsOpenFile* fof,int colnum
    334                           ,int ihdu,long blen,long bsens,int lp)
    335 {
    336   Init(fof,"",colnum,ihdu,blen,bsens,lp);
     327FitsABTColRd::FitsABTColRd(FitsOpenFile* fof,int colnum,int ihdu,int lp)
     328{
     329  Init(fof,"",colnum,ihdu,lp);
    337330}
    338331
     
    340333FitsABTColRd::FitsABTColRd(FitsABTColRd& fbt)
    341334{
    342   Init(fbt.GetFitsOpenFile(),fbt.GetColLabel().c_str()
    343       ,fbt.GetColNum(),fbt.HDU()
    344       ,fbt.GetBLen(),fbt.GetBSens(),fbt.DbgLevel);
     335  Init(fbt.GetFitsOpenFile(),fbt.GetColLabel().c_str(),fbt.GetColNum(),fbt.HDU(),fbt.DbgLevel);
    345336}
    346337
     
    355346 NFitsRead = 0;
    356347 FitsOF = NULL;
    357  LineDeb = LineFin = -1;
    358  Buffer = NULL;
    359348}
    360349
    361350/*! Init routine called by the constructor */
    362 void FitsABTColRd::Init(FitsOpenFile* fof,const char* collabel,int colnum
    363                         ,int ihdu,long blen,long bsens,int lp)
     351void FitsABTColRd::Init(FitsOpenFile* fof,const char* collabel,int colnum,int ihdu,int lp)
    364352{
    365353 // Initialisation des Parametres Generaux
     
    371359 NFitsRead = 0;
    372360 FitsOF = NULL;
    373  LineDeb = LineFin = -1;
    374  Buffer = NULL;
    375361
    376362 // Caracteristiques du FitsOpenFile
     
    475461 fits_get_col_display_width(GetFitsPtr(),ColNum+1,&ColDispWidth,&sta);
    476462
    477  // Set the buffer for reading
    478  ChangeBuffer(blen,bsens);
    479 
    480463 if(DbgLevel)
    481464   cout<<"FitsABTColRd::Init Num="<<ColNum<<" Label="<<ColLabel
     
    497480{
    498481 if(StrBuff!=NULL) {delete [] StrBuff; StrBuff=NULL;}
    499  if(Buffer!=NULL) {delete [] Buffer; Buffer=NULL;}
    500  LineDeb = LineFin = -1;
    501482 //--- Surtout on ne "fits_close_file" pas le fichier FITS !!!
    502 }
    503 
    504 //////////////////////////////////////////////////////////////
    505 /*! Change the buffer caracteristiques (see creator) */
    506 void FitsABTColRd::ChangeBuffer(long blen,long bsens)
    507 {
    508  long oldnbuffer = NBuffer;
    509 
    510  // Compute buffer caracteristics
    511  BuffLen = (blen<=0 || ColRepeat!=1)? 1: blen;
    512  BuffSens = bsens;
    513  NBuffer = BuffLen;
    514  if(bsens==0 && NBuffer%2==0) NBuffer++;
    515 
    516  // De-allocate if necessary
    517  if(Buffer!=NULL) {
    518    // On des-alloue si pas assez de place
    519    // ou si l'ancienne place est beaucoup trop grande (>25%)
    520    if(oldnbuffer<NBuffer || (oldnbuffer>NBuffer+long(0.25*NBuffer)) )
    521      {delete [] Buffer; Buffer=NULL;}
    522  }
    523 
    524  // Re-allocate
    525  if(Buffer==NULL) Buffer = new double[NBuffer];
    526 
    527  // Tell program that nothing is into buffer
    528  LineDeb = LineFin = -1;
    529483}
    530484
     
    576530  \return value in double
    577531  \param n : number of the row to be read.
    578   \verbatim
    579   usebuffer == true  : use read optimisation with bufferisation
    580             == false : no optimisation with bufferisation
    581                        just read one value
    582   \endverbatim
    583 */
    584 double FitsABTColRd::Read(LONGLONG n,long nfirstel,bool usebuffer)
     532*/
     533double FitsABTColRd::Read(LONGLONG n,long nfirstel)
    585534// Attention: n=nline [0,NBline[, cfistio veut [1,NBline]
    586535// Attention: colnum  [0,NBcol[ , cfistio veut [1,NBcol]
     
    593542   throw RangeCheckError("FitsABTColRd::Read try to read outside element range: nfirstel>repeat\n");
    594543
    595  // Pas de bufferisation (ou repeat=1), on lit betement
    596  if(NBuffer==1 || !usebuffer || ColRepeat!=1) {
    597    NFitsRead++;
    598    double val;
    599    fits_read_col(GetFitsPtr(),TDOUBLE,ColNum+1,n+1,nfirstel+1,1,NULL,&val,NULL,&sta);
    600    if(sta) {
    601      FitsOpenFile::printerror(sta);
    602      throw NotAvailableOperation("FitsABTColRd::Read: Error Reading Fits file\n");
    603    }
    604    // On ne remplit Buffer[0] que si on a choisit
    605    // un mode de lecture non bufferise (n==1) DES LE DEBUT.
    606    // Si on a initialement choisit un mode bufferise (avec n>1),
    607    // Buffer contient les valeurs chargees auparavent.
    608    // Il ne faut pas faire {Buffer[0]=val; LineDeb=LineFin=n;}
    609    // car on perd l'info de ces valeurs.
    610    if(NBuffer==1) {Buffer[0]=val; LineDeb=LineFin=n;}
    611    return val;
    612  }
    613 
    614  // Gestion avec bufferisation (uniquement dans le cas repeat=1)
    615  if(!Buffer)
    616    throw RangeCheckError("FitsABTColRd::Read: Buffer not allocated\n");
    617  if(n<LineDeb || n>LineFin) {
    618    NFitsRead++;
    619    LONGLONG row1,row2,nrow;
    620    if(BuffSens>0) { // Cas remplissage forward
    621      row1 = n+1;
    622      row2 = row1+NBuffer-1; if(row2>NBline) row2 = NBline;
    623    } else if(BuffSens<0) { // Cas remplissage backward
    624      row2 = n+1;
    625      row1 = row2-NBuffer+1; if(row1<1) row1 = 1;
    626    } else { // Cas remplissage centre
    627      row1 = n+1 - NBuffer/2; if(row1<1) row1 = 1;
    628      row2 = n+1 + NBuffer/2; if(row2>NBline) row2 = NBline;
    629    }
    630    nrow = row2 - row1 + 1;
    631    LineDeb = row1-1; LineFin = row2-1;
    632    //cout<<"DBG-FitsRead: row1="<<row1<<" row2="<<row2<<" nrow="<<nrow
    633    //    <<" LineDeb,Fin="<<LineDeb<<","<<LineFin<<endl;
    634    fits_read_col(GetFitsPtr(),TDOUBLE,ColNum+1,row1,1,nrow,NULL,Buffer,NULL,&sta);
    635    if(sta) {
    636      FitsOpenFile::printerror(sta);
    637      LineDeb = LineFin = -1;
    638      throw NotAvailableOperation("FitsABTColRd::Read: Error Reading Fits file\n");
    639    }
    640  }
    641 
    642  long ibuf = n-LineDeb;
    643  return Buffer[ibuf];
     544 double val;
     545 fits_read_col(GetFitsPtr(),TDOUBLE,ColNum+1,n+1,nfirstel+1,1,NULL,&val,NULL,&sta);
     546 if(sta) {
     547   FitsOpenFile::printerror(sta);
     548   throw NotAvailableOperation("FitsABTColRd::Read: Error Reading Fits file\n");
     549 }
     550 NFitsRead++;
     551 return val;
     552}
     553
     554/*!
     555  Read row "n" element "nfirstel" and return a long long int
     556*/
     557int_8 FitsABTColRd::ReadLL(LONGLONG n,long nfirstel)
     558{
     559 int sta=0;
     560 if(n<0 || n>=NBline)
     561   throw RangeCheckError("FitsABTColRd::ReadLL try to read outside line range\n");
     562 if(nfirstel<0 || nfirstel>=ColRepeat)
     563   throw RangeCheckError("FitsABTColRd::ReadLL try to read outside element range: nfirstel>repeat\n");
     564
     565 int_8 val;
     566 fits_read_col(GetFitsPtr(),TLONGLONG,ColNum+1,n+1,nfirstel+1,1,NULL,&val,NULL,&sta);
     567 if(sta) {
     568   FitsOpenFile::printerror(sta);
     569   throw NotAvailableOperation("FitsABTColRd::ReadLL: Error Reading Fits file\n");
     570 }
     571 NFitsRead++;
     572 return val;
    644573}
    645574
     
    661590   throw NotAvailableOperation("FitsABTColRd::ReadComplex: Error Reading Fits file\n");
    662591 }
     592 NFitsRead++;
    663593 return complex<r_8>(val[0],val[1]);
    664594}
     
    678608 char nullstr[]="";
    679609
    680  NFitsRead++;
    681610 fits_read_col(GetFitsPtr(),TSTRING,ColNum+1,n+1,nfirstel+1,1,nullstr,&StrBuff,NULL,&sta);
    682611 if(sta) {
     
    684613   throw NotAvailableOperation("FitsABTColRd::ReadInStr: Error Reading Fits file\n");
    685614 }
     615 NFitsRead++;
    686616
    687617 return StrBuff;
     
    741671   throw NotAvailableOperation("FitsABTColRd::Read_TVector<double>: Error Reading Fits file\n");
    742672 }
     673 NFitsRead += nread;
    743674
    744675 return nread;
     
    767698   throw NotAvailableOperation("FitsABTColRd::Read_TVector<float>: Error Reading Fits file\n");
    768699 }
     700 NFitsRead += nread;
    769701
    770702 return nread;
     
    792724   throw NotAvailableOperation("FitsABTColRd::Read_TVector<uint_2>: Error Reading Fits file\n");
    793725 }
     726 NFitsRead += nread;
    794727
    795728 return nread;
     
    819752   throw NotAvailableOperation("FitsABTColRd::Read_TVector<int_4>: Error Reading Fits file\n");
    820753 }
     754 NFitsRead += nread;
    821755
    822756 return nread;
     
    845779   throw NotAvailableOperation("FitsABTColRd::Read_TVector<int_8>: Error Reading Fits file\n");
    846780 }
     781 NFitsRead += nread;
    847782
    848783 return nread;
     
    870805 LONGLONG row = -1;
    871806 if(NBline==0) return row;
    872  // Change buffer for efficiency
    873  long bsens=BuffSens; bool bchange=false;
    874  if(bsens<=0) {ChangeBuffer(BuffLen,1); bchange=true;}
    875807 if(rowstart<0) rowstart = 0;
    876808 if(rowstart>=NBline) rowstart = NBline-1;
     
    881813   break;
    882814 }
    883  if(bchange) ChangeBuffer(BuffLen,bsens);
    884815 return row;
    885816}
     
    902833 LONGLONG row = -1;
    903834 if(NBline==0) return row;
    904  // Change buffer for efficiency
    905  long bsens=BuffSens; bool bchange=false;
    906  if(bsens>=0) {ChangeBuffer(BuffLen,-1); bchange=true;}
    907835 if(rowstart<0 || rowstart>=NBline) rowstart = NBline-1;
    908836 for(LONGLONG i=rowstart;i>=0;i--) {
     
    912840   break;
    913841 }
    914  if(bchange) ChangeBuffer(BuffLen,bsens);
    915842 return row;
    916843}
     
    919846void FitsABTColRd::Print(ostream& os,int lp) const
    920847{
    921  os<<"FitsABTColRd:Print ("<<BuffLen<<","<<BuffSens<<","<<NulVal<<")"
     848 os<<"FitsABTColRd:Print ("<<NulVal<<")"
    922849   <<" ncols="<<NBcol<<" nrows="<<NBline;
    923850 if(lp>0) os<<" NRead="<<NFitsRead;
     
    971898  \param collabel : label of the column to be read
    972899  \param ihdu : number of the HDU where the column is.
    973   \param blen : read buffer length
    974   \param bsens : buffer reading direction
    975900  \param lp : debug level
    976901  \verbatim
    977902  - if ihdu<=0 first BINARY or ASCII table is taken
    978903  - if ihdu>nhdu ihdu is set to nhdu
    979   - bsens>0    read forward
    980     bsens<0    read backward
    981     bsens==0   read centered
    982904  \endverbatim
    983905  \warning ihdu = [1,nhdu]
    984906*/
    985 FitsABTColRead::FitsABTColRead(string fname,string collabel
    986                               ,int ihdu,long blen,long bsens,int lp)
    987 : FitsABTColRd(new FitsOpenFile(fname),collabel,ihdu,blen,bsens,lp)
     907FitsABTColRead::FitsABTColRead(string fname,string collabel,int ihdu,int lp)
     908: FitsABTColRd(new FitsOpenFile(fname),collabel,ihdu,lp)
    988909{
    989910}
     
    995916  \warning col = [0,ncol[
    996917*/
    997 FitsABTColRead::FitsABTColRead(string fname,int colnum
    998                               ,int ihdu,long blen,long bsens,int lp)
    999 : FitsABTColRd(new FitsOpenFile(fname),colnum,ihdu,blen,bsens,lp)
     918FitsABTColRead::FitsABTColRead(string fname,int colnum,int ihdu,int lp)
     919: FitsABTColRd(new FitsOpenFile(fname),colnum,ihdu,lp)
    1000920{
    1001921}
    1002922
    1003923/*! Constructor. see below */
    1004 FitsABTColRead::FitsABTColRead(const char * cfname,const char* collabel
    1005                               ,int ihdu,long blen,long bsens,int lp)
    1006 : FitsABTColRd(new FitsOpenFile(cfname),collabel,ihdu,blen,bsens,lp)
     924FitsABTColRead::FitsABTColRead(const char * cfname,const char* collabel,int ihdu,int lp)
     925: FitsABTColRd(new FitsOpenFile(cfname),collabel,ihdu,lp)
    1007926{
    1008927}
    1009928
    1010929/*! Constructor. see below */
    1011 FitsABTColRead::FitsABTColRead(const char * cfname,int colnum
    1012                               ,int ihdu,long blen,long bsens,int lp)
    1013 : FitsABTColRd(new FitsOpenFile(cfname),colnum,ihdu,blen,bsens,lp)
     930FitsABTColRead::FitsABTColRead(const char * cfname,int colnum,int ihdu,int lp)
     931: FitsABTColRd(new FitsOpenFile(cfname),colnum,ihdu,lp)
    1014932{
    1015933}
     
    1026944 // FitsABTColRead ferme le fichier FITS: il faut dupliquer le FitsOpenFile
    1027945 FitsOpenFile* fof = new FitsOpenFile(*fbt.GetFitsOpenFile());
    1028  Init(fof,fbt.GetColLabel().c_str()
    1029      ,fbt.GetColNum(),fbt.HDU()
    1030      ,fbt.GetBLen(),fbt.GetBSens(),fbt.DbgLevel);
     946 Init(fof,fbt.GetColLabel().c_str(),fbt.GetColNum(),fbt.HDU(),fbt.DbgLevel);
    1031947}
    1032948
     
    12391155  \return value in double
    12401156  \param n : number of the row to be read.
    1241   \verbatim
    1242   usebuffer == true  : use read optimisation with bufferisation
    1243             == false : no optimisation with bufferisation
    1244                        just read one value
    1245   \endverbatim
    12461157*/
    12471158double FitsABTColRd1F::Read(int ColNum,LONGLONG n,long nfirstel)
     
    12691180
    12701181/*!
     1182  Read row "n" element "nfirstel" and return a long long int
     1183*/
     1184int_8 FitsABTColRd1F::ReadLL(int ColNum,LONGLONG n,long nfirstel)
     1185{
     1186 int sta=0;
     1187 if(ColNum<0 || ColNum>=NBcol)
     1188   throw RangeCheckError("FitsABTColRd1F::ReadLL try to read outside column range\n");
     1189 if(n<0 || n>=NBline)
     1190   throw RangeCheckError("FitsABTColRd1F::ReadLL try to read outside line range\n");
     1191 if(nfirstel<0 || nfirstel>=ColRepeat[ColNum])
     1192   throw RangeCheckError("FitsABTColRd1F::ReadLL try to read outside element range: nfirstel>repeat\n");
     1193
     1194 int_8 val;
     1195 fits_read_col(GetFitsPtr(),TLONGLONG,ColNum+1,n+1,nfirstel+1,1,NULL,&val,NULL,&sta);
     1196 if(sta) {
     1197   FitsOpenFile::printerror(sta);
     1198   throw NotAvailableOperation("FitsABTColRd1F::ReadLL: Error Reading Fits file\n");
     1199 }
     1200 return val;
     1201}
     1202
     1203
     1204/*!
    12711205  Read row "n" element "nfirstel" and return a complex value
    12721206*/
     
    13111245   throw NotAvailableOperation("FitsABTColRd::ReadInStr: Error Reading Fits file\n");
    13121246 }
    1313 
    13141247 return StrBuff[ColNum];
    13151248}
  • trunk/SophyaExt/FitsIOServer/fabtcolread.h

    r4025 r4029  
    6868class FitsABTColRd : public AnyDataObj {
    6969public:
    70   FitsABTColRd(FitsOpenFile* fof,string collabel,int ihdu=0
    71               ,long blen=100,long bsens=1,int lp=0);
    72   FitsABTColRd(FitsOpenFile* fof,int colnum,int ihdu=0
    73               ,long blen=100,long bsens=1,int lp=0);
     70  FitsABTColRd(FitsOpenFile* fof,string collabel,int ihdu=0,int lp=0);
     71  FitsABTColRd(FitsOpenFile* fof,int colnum,int ihdu=0,int lp=0);
    7472  FitsABTColRd(FitsABTColRd& fbt);
    7573  FitsABTColRd();
    7674  virtual ~FitsABTColRd();
    77 
    78   void ChangeBuffer(long blen=100,long bsens=1);
    7975
    8076  double    ReadKey(const char *keyname);
     
    8379  string    ReadKeyS(const char *keyname);
    8480
    85   double Read(LONGLONG n,long nfirstel,bool usebuffer=true);
    86   inline double Read(LONGLONG n,bool usebuffer=true) {return Read(n,0,usebuffer);}
     81  double Read(LONGLONG n,long nfirstel=0);
     82  int_8  ReadLL(LONGLONG n,long nfirstel=0);
    8783  complex<r_8> ReadComplex(LONGLONG n,long nfirstel=0);
    8884  char* ReadInStr(LONGLONG n,long nfirstel=0);
     
    9591
    9692  //! return the value of the first row
    97   double ReadFirstRow(long nfirstel,bool usebuffer=false) {return Read(0,nfirstel,usebuffer);}
    98   double ReadFirstRow(bool usebuffer=false) {return Read(0,usebuffer);}
     93  double ReadFirstRow(long nfirstel) {return Read(0,nfirstel);}
     94  double ReadFirstRow(void) {return Read(0);}
    9995  //! return the value of the last row
    100   double ReadLastRow(long nfirstel,bool usebuffer=false) {return Read(NBline-1,nfirstel,usebuffer);}
    101   double ReadLastRow(bool usebuffer=false) {return Read(NBline-1,usebuffer);}
     96  double ReadLastRow(long nfirstel) {return Read(NBline-1,nfirstel);}
     97  double ReadLastRow(void) {return Read(NBline-1);}
    10298
    10399  LONGLONG FirstRow(long nfirstel,double val1,double val2,LONGLONG rowstart=-1);
     
    144140  //! Get the columns fits repeat that is read
    145141  inline long GetColRepeat(void) const {return ColRepeat;}
    146   //! Get the read requested buffer length
    147   inline long GetBLen(void) const {return BuffLen;}
    148   //! Get the read buffer direction
    149   inline long GetBSens(void) const {return BuffSens;}
    150142  //! Print to os
    151143  virtual void Print(ostream& os,int lp=1) const;
    152144  //! Print to stdout
    153145  inline  void Print(int lp=1) const {Print(cout,lp);}
    154   //! Get the read effective buffer length
    155   inline long GetNBuffer(void) const {return NBuffer;}
    156   //! Get the read bufferpointer
    157   inline double* GetBuffer(void) {return Buffer;}
    158146
    159147protected:
    160   void Init(FitsOpenFile* fof,const char *collabel,int colnum
    161            ,int ihdu,long blen,long bsens,int lp);
     148  void Init(FitsOpenFile* fof,const char *collabel,int colnum,int ihdu,int lp);
    162149  void Delete(void);
    163150
     
    170157  double NulVal;
    171158  unsigned short DbgLevel;
    172   long BuffLen, BuffSens;
    173159
    174160  LONGLONG NFitsRead;
    175161  FitsOpenFile* FitsOF;
    176   LONGLONG LineDeb, LineFin;
    177   double *Buffer;
    178   long NBuffer;
    179162};
    180163
     
    183166class FitsABTColRead : public FitsABTColRd {
    184167public:
    185   FitsABTColRead(string fname,string collabel,int ihdu=0
    186                 ,long blen=100,long bsens=1,int lp=0);
    187   FitsABTColRead(string fname,int colnum,int ihdu=0
    188                 ,long blen=100,long bsens=1,int lp=0);
    189   FitsABTColRead(const char *cfname,const char *collabel,int ihdu=0
    190                 ,long blen=100,long bsens=1,int lp=0);
    191   FitsABTColRead(const char *cfname,int colnum,int ihdu=0
    192                 ,long blen=100,long bsens=1,int lp=0);
     168  FitsABTColRead(string fname,string collabel,int ihdu=0,int lp=0);
     169  FitsABTColRead(string fname,int colnum,int ihdu=0,int lp=0);
     170  FitsABTColRead(const char *cfname,const char *collabel,int ihdu=0,int lp=0);
     171  FitsABTColRead(const char *cfname,int colnum,int ihdu=0,int lp=0);
    193172  FitsABTColRead(FitsABTColRead& fbt);
    194173  FitsABTColRead();
     
    198177
    199178///////////////////////////////////////////////////////////////////
    200 //! Class for reading ALL the columns in a FITS ASCII or BINARY table (no bufferisation)
     179//! Class for reading ALL the columns in a FITS ASCII or BINARY table
    201180class FitsABTColRd1F : public AnyDataObj {
    202181public:
     
    209188  string    ReadKeyS(const char *keyname);
    210189
    211   double Read(int ColNum,LONGLONG n,long nfirstel);
    212   inline double Read(int ColNum,LONGLONG n) {return Read(ColNum,n,0);}
     190  double Read(int ColNum,LONGLONG n,long nfirstel=0);
     191  int_8  ReadLL(int ColNum,LONGLONG n,long nfirstel=0);
    213192  complex<r_8> ReadComplex(int ColNum,LONGLONG n,long nfirstel=0);
    214193  char* ReadInStr(int ColNum,LONGLONG n,long nfirstel=0);
     
    258237  //! Print to stdout
    259238  inline  void Print(int lp=1) const {Print(cout,lp);}
    260   //! Get the read effective buffer length
    261239
    262240protected:
  • trunk/SophyaExt/FitsIOServer/fboloread.cc

    r3128 r4029  
    1515  \verbatim
    1616  -- Exemple:
    17   FitsBoloRead fbr(blen,bsens);
     17  FitsBoloRead fbr;
    1818  fbr.SetDebug(2);
    1919
     
    5858/*!
    5959  Constructor. Define the structure of the bolometer columns connector.
    60   \param blen : read buffer length
    61   \param bsens : buffer reading direction
    62   \verbatim
    63   - bsens>0    read forward
    64     bsens<0    read backward
    65     bsens==0   read centered
    66   \endverbatim
    67 */
    68 FitsBoloRead::FitsBoloRead(long blen,long bsens)
    69   : NBline(0), DbgLevel(0), BuffLen(blen), BuffSens(bsens)
     60*/
     61FitsBoloRead::FitsBoloRead(void)
     62  : NBline(0), DbgLevel(0)
    7063{
    7164  for(int i=0;i<_NCOL_BOLO_MIN_;i++) {
     
    144137
    145138 mFABT[col] =
    146    new FitsABTColRead(mFName[col].c_str(),mLabel[col].c_str()
    147                      ,mHDU[col],BuffLen,BuffSens,(int)DbgLevel);
     139   new FitsABTColRead(mFName[col].c_str(),mLabel[col].c_str(),mHDU[col],(int)DbgLevel);
    148140
    149141 // Set the number of rows as the smallest of for connected columns
  • trunk/SophyaExt/FitsIOServer/fboloread.h

    r3493 r4029  
    2626  enum {ColSNum=0, ColBolo=1, ColFlag=2, ColAlpha=3, ColDelta=4};
    2727
    28   FitsBoloRead(long blen=100,long bsens=1);
     28  FitsBoloRead(void);
    2929  virtual ~FitsBoloRead();
    3030
     
    4949
    5050  //! return Alpha value for row "n" into double
    51   inline double GetAlpha(LONGLONG n,bool usebuffer=true)
    52                 {return GetCol(ColAlpha,n,usebuffer);}
     51  inline double GetAlpha(LONGLONG n)
     52                {return GetCol(ColAlpha,n);}
    5353  //! return Delta value for row "n" into double
    54   inline double GetDelta(LONGLONG n,bool usebuffer=true)
    55                 {return GetCol(ColDelta,n,usebuffer);}
     54  inline double GetDelta(LONGLONG n)
     55                {return GetCol(ColDelta,n);}
    5656  //! return Bolo value for row "n" into double
    57   inline double GetBolo(LONGLONG n,bool usebuffer=true)
    58                 {return GetCol(ColBolo,n,usebuffer);}
     57  inline double GetBolo(LONGLONG n)
     58                {return GetCol(ColBolo,n);}
    5959  //! return Flag value for row "n" into double
    60   inline double GetFlag(LONGLONG n,bool usebuffer=true)
    61          {if(!IsFlag()) return 0.; return GetCol(ColFlag,n,usebuffer);}
     60  inline double GetFlag(LONGLONG n)
     61         {if(!IsFlag()) return 0.; return GetCol(ColFlag,n);}
    6262  //! return SNum value for row "n" into double
    63   inline double GetSNum(LONGLONG n,bool usebuffer=true)
    64                 {return GetCol(ColSNum,n,usebuffer);}
     63  inline double GetSNum(LONGLONG n) {return GetCol(ColSNum,n);}
    6564  //! return column "col" value for row "n" into double
    66   inline double GetCol(int col,LONGLONG n,bool usebuffer=true) {
     65  inline double GetCol(int col,LONGLONG n) {
    6766    if(col<0 || col>=(int)mFABT.size())
    6867      throw ParmError("FitsBoloRead::GetCol: bad column number\n");
    6968    if(mFABT[col]==NULL)
    7069      throw NullPtrError("FitsBoloRead::GetCol: column not connected\n");
    71     return mFABT[col]->Read(n,usebuffer);
     70    return mFABT[col]->Read(n);
    7271  }
    7372
     
    127126
    128127  //! return the value of the first sampleNum
    129   inline double ReadFirstSNum(void) {return GetSNum(0,false);}
     128  inline double ReadFirstSNum(void) {return GetSNum(0);}
    130129  //! return the value of the last sampleNum
    131   inline double ReadLastSNum(void)  {return GetSNum(NBline-1,false);}
     130  inline double ReadLastSNum(void)  {return GetSNum(NBline-1);}
    132131
    133132  //! Is Alpha connected ?
     
    152151  //! Get the number of columns in the FITS HDU to be read
    153152  inline int  GetNbCol(void) const {return mFABT.size();}
    154   //! Get the read requested buffer length
    155   inline long GetBLen(void) const {return BuffLen;}
    156   //! Get the read buffer direction
    157   inline long GetBSens(void) const {return BuffSens;}
    158   //! Print to os
     153 //! Print to os
    159154  virtual void Print(ostream& os,int lp=1) const;
    160155  //! Print to stdout
  • trunk/SophyaProg/Tests/tstboloread.cc

    r3572 r4029  
    3636      *fits_snum   = "";
    3737 int hdu_alpha=0, hdu_delta=0, hdu_bolo=0, hdu_flag=0, hdu_snum=0;
    38  long blen = 100, bsens = 1, lpmod=1;
     38 long lpmod=1;
    3939 char c;
    40  while((c = getopt(narg,arg,"ha:d:s:b:f:A:D:S:B:F:1:2:3:4:5:L:m:")) != -1) {
     40 while((c = getopt(narg,arg,"ha:d:s:b:f:A:D:S:B:F:1:2:3:4:5:m:")) != -1) {
    4141   switch (c) {
    4242   case 'a' :
     
    8585     sscanf(optarg,"%d",&hdu_snum);
    8686     break;
    87    case 'L' :
    88      sscanf(optarg,"%ld,%ld",&blen,&bsens);
    89      break;
    9087   case 'm' :
    9188     sscanf(optarg,"%ld",&lpmod);
     
    9491   case 'h' :
    9592   default :
    96      cout<<"cmvcolread -L buflen,sens -m print_modulo"
     93     cout<<"cmvcolread   -m print_modulo"
    9794         <<"\n           -a label_alpha -d label_delta"
    9895         <<"\n           -b label_bolo  -f label_flag"
     
    119116#endif
    120117
    121   FitsBoloRead fbr(blen,bsens);
     118  FitsBoloRead fbr;
    122119  fbr.SetDebug(3);
    123120  fbr.Print(3);
  • trunk/SophyaProg/Tests/tstcolread.cc

    r3572 r4029  
    2424 int colnum = -1;
    2525 int ihdu = 0;
    26  long blen = 100;
    27  long bsens = 1;
    2826 long lpmod=1;
    2927 double vs1,vs2; bool vsearch=false;
    3028 char c;
    31  while((c = getopt(narg,arg,"hb:s:H:i:c:m:v:")) != -1) {
     29 while((c = getopt(narg,arg,"hH:i:c:m:v:")) != -1) {
    3230   switch (c) {
    33    case 'b' :
    34      sscanf(optarg,"%ld",&blen);
    35      break;
    36    case 's' :
    37      sscanf(optarg,"%ld",&bsens);
    38      break;
    3931   case 'H' :
    4032     sscanf(optarg,"%d",&ihdu);
     
    8072
    8173  if(strlen(colname)>0)
    82     fbt = new FitsABTColRead(fitsname,colname,ihdu,blen,bsens,3);
     74    fbt = new FitsABTColRead(fitsname,colname,ihdu,3);
    8375  else
    84     fbt = new FitsABTColRead(fitsname,colnum,ihdu,blen,bsens,3);
     76    fbt = new FitsABTColRead(fitsname,colnum,ihdu,3);
    8577  fbt->SetDebug(3);
    8678  fbt->Print(3);
Note: See TracChangeset for help on using the changeset viewer.