src/GamIO/XWinSer.cc
/* These functions will read in a single FID from the Bruker acqusition file
   and or a series of FID's from a Bruker serial file. The FID values are read
   in as re,im,re,im,...., each point stored as a 32-bit integer.  It is very
   important that we know the number of points in an FID and the byte order
   used in storing the data.  This information must be supplied, either when
   calling the function(s) or when constructing objects of this class type.
   Such information is usually read in from a corresponding ASCII parameter
   file, typically named acqus in the case of a sinlge FID file (fid) or 
   called acqu2s in case of a stacked FID serial file (ser). Such details
   should be attended to in higher classes utilizing these functions.

   Function   Arguments              Action                       Return
   --------  ------------  -----------------------------------  ----------
   readFID   fn,TD,BO,I    Read Ith block in serial/FID file    row_vector
 + readFID   idx           Read block of index idx(-1=current)  row_vector
   readFIDs  fn,TD,BO,I,J  Read a set of J FID's from Ith one     matrix
 + readFIDs  I,NB          Read a set of NB FID's from Ith one    matrix
   readSer   fn,TD,bytord  Read entire serial file                matrix
 + readSer                 Read entire serial file                matrix
 
 Above X=Currently Inactive, +=File Must Be Properly Opened For Reading      */
These functions will read in a single FID from the Bruker acqusition file
and or a series of FID's from a Bruker serial file. The FID values are read
in as re,im,re,im,...., each point stored as a 32-bit integer.  It is very
important that we know the number of points in an FID and the byte order
used in storing the data.  This information must be supplied, either when
calling the function(s) or when constructing objects of this class type.
Such information is usually read in from a corresponding ASCII parameter
file, typically named acqus in the case of a sinlge FID file (fid) or
called acqu2s in case of a stacked FID serial file (ser). Such details
should be attended to in higher classes utilizing these functions.

Function   Arguments              Action                       Return

readFID   fn,TD,BO,I    Read Ith block in serial/FID file    row_vector
+ readFID   idx           Read block of index idx(-1=current)  row_vector
readFIDs  fn,TD,BO,I,J  Read a set of J FID's from Ith one     matrix
+ readFIDs  I,NB          Read a set of NB FID's from Ith one    matrix
readSer   fn,TD,bytord  Read entire serial file                matrix
+ readSer                 Read entire serial file                matrix

Above X=Currently Inactive, +=File Must Be Properly Opened For Reading
These functions will read in a single FID from the Bruker acqusition file and or a series of FID ' s from a Bruker serial file . The FID values are read in as re im re im .... each point stored as a 32 - bit integer . It is very important that we know the number of points in an FID and the byte order used in storing the data . This information must be supplied either when calling the function ( s ) or when constructing objects of this class type . Such information is usually read in from a corresponding ASCII parameter file typically named acqus in the case of a sinlge FID file ( fid ) or called acqu2s in case of a stacked FID serial file ( ser ) . Such details should be attended to in higher classes utilizing these functions . Function Arguments Action Return readFID fn TD BO I Read Ith block in serial / FID file row_vector + readFID idx Read block of index idx ( - 1 = current ) row_vector readFIDs fn TD BO I J Read a set of J FID ' s from Ith one matrix + readFIDs I NB Read a set of NB FID ' s from Ith one matrix readSer fn TD bytord Read entire serial file matrix + readSer Read entire serial file matrix Above X = Currently Inactive + = File Must Be Properly Opened For Reading
row_vector XWinSer::readFID(const std::string& fin, int TD, int bord, int idx)
  {
  bool byteord = (bord)?true:false;
  if(bord == -1) bord = WeRBigEnd();	
  XWinSer XWA(fin,TD,byteord,std::ios::binary|std::ios::in);	
  return XWA.readFID(idx);			
  }
row_vector XWinSer :: readFID ( const std :: string & fin , int TD , int bord , int idx ) { bool byteord = ( bord ) ? true : false ; if ( bord == -1 ) bord = WeRBigEnd ( ) ; XWinSer XWA ( fin , TD , byteord , std :: ios :: binary | std :: ios :: in ) ; return XWA . readFID ( idx ) ; }
These functions will read in a single FID from the Bruker acqusition file
and or a series of FID's from a Bruker serial file.
These functions will read in a single FID from the Bruker acqusition file and or a series of FID ' s from a Bruker serial file .
// Our byte order if not set // Open Bruker serial file // Use function overload