Ignore:
Timestamp:
Oct 19, 2009, 5:36:13 PM (16 years ago)
Author:
cmv
Message:

intro FABTColRead1F, cmv 19/10/2009

File:
1 edited

Legend:

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

    r3572 r3660  
    187187
    188188///////////////////////////////////////////////////////////////////
     189//! Class for reading ALL the columns in a FITS ASCII or BINARY table
     190class FitsABTColRd1F : public AnyDataObj {
     191public:
     192  FitsABTColRd1F(FitsOpenFile* fof,int ihdu=0
     193              ,long blen=100,long bsens=1,int lp=0);
     194  virtual ~FitsABTColRd1F();
     195
     196  void ChangeBuffer(long blen=100,long bsens=1);
     197
     198  double    ReadKey(const char *keyname);
     199  long      ReadKeyL(const char *keyname);
     200  LONGLONG  ReadKeyLL(const char *keyname);
     201  string    ReadKeyS(const char *keyname);
     202
     203  double Read(int ColNum,LONGLONG n,bool usebuffer=true);
     204  int GetColNum(const char *colname);
     205
     206  //! Set debug level
     207  inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
     208  //! Set null value to be return when reading null data (0=return the data)
     209  inline void SetNulVal(double nulval=0.) {NulVal = nulval;}
     210  //! Get the FITS file name
     211  inline string FileName(void) const
     212         {if(FitsOF) return FitsOF->FileName(); else return (string)"";}
     213  //! Get the pointer to FitsOpenFile
     214  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
     215  //! Get the FITS file pointer (cfistio pointer)
     216  inline fitsfile* GetFitsPtr(void) const {return FitsOF->GetFitsPtr();}
     217  //! Get the number of HDU in the FITS file
     218  inline int NHDU(void) const
     219         {if(FitsOF) return FitsOF->NHDU(); else return 0;}
     220  //! Get the number of the HDU read
     221  inline int HDU(void) const
     222         {if(FitsOF) return FitsOF->HDU(); else return 0;}
     223  //! Get the HDU type
     224  inline int HDUType(void) const
     225         {if(FitsOF) return FitsOF->HDUType(); else return 0;}
     226  //! Get the number of rows in the FITS HDU to be read
     227  inline LONGLONG GetNbLine(void) const {return NBline;}
     228  //! Get the number of columns in the FITS HDU to be read
     229  inline int GetNbCol(void) const {return NBcol;}
     230  //! Get the columns label that is read
     231  inline string GetColLabel(int ColNum) const
     232         {if(ColNum<0 || ColNum>=NBcol) return string(""); else return ColLabel[ColNum];}
     233  //! Get the columns type code that is read
     234  inline int GetColTypeCode(int ColNum) const
     235         {if(ColNum<0 || ColNum>=NBcol) return -999; else return ColTypeCode[ColNum];}
     236  //! Get the columns fits tunit that is read
     237  inline string GetColTUnit(int ColNum) const
     238         {if(ColNum<0 || ColNum>=NBcol) return string(""); else return ColTUnit[ColNum];}
     239  //! Get the columns fits tform that is read
     240  inline string GetColTForm(int ColNum) const
     241         {if(ColNum<0 || ColNum>=NBcol) return string(""); else return ColTForm[ColNum];}
     242  //! Get the read requested buffer length
     243  inline long GetBLen(void) const {return BuffLen;}
     244  //! Get the read buffer direction
     245  inline long GetBSens(void) const {return BuffSens;}
     246  //! Print to os
     247  virtual void Print(ostream& os,int lp=1) const;
     248  //! Print to stdout
     249  inline  void Print(int lp=1) const {Print(cout,lp);}
     250  //! Get the read effective buffer length
     251  inline long GetNBuffer(void) const {return NBuffer;}
     252  //! Get the read bufferpointer
     253  inline double* GetBuffer(int ColNum)
     254         {if(ColNum<0 || ColNum>=NBcol) return NULL; else return Buffer[ColNum];}
     255
     256protected:
     257  void Init(FitsOpenFile* fof,int ihdu,long blen,long bsens,int lp);
     258  void Delete(void);
     259
     260  vector<string> ColLabel,ColTUnit,ColTForm;
     261  vector<int> ColTypeCode;
     262  int NBcol;
     263  LONGLONG NBline;
     264
     265  double NulVal;
     266  unsigned short DbgLevel;
     267  long BuffLen, BuffSens;
     268
     269  FitsOpenFile* FitsOF;
     270  vector<LONGLONG> LineDeb, LineFin;
     271  double **Buffer;
     272  long NBuffer;
     273};
     274
     275
     276///////////////////////////////////////////////////////////////////
     277//! Class for reading ALL the columns in a FITS ASCII or BINARY table with fits file opening
     278class FitsABTColRead1F : public FitsABTColRd1F {
     279public:
     280  FitsABTColRead1F(string fname,int ihdu=0
     281                ,long blen=100,long bsens=1,int lp=0);
     282  FitsABTColRead1F(const char *cfname,int ihdu=0
     283                ,long blen=100,long bsens=1,int lp=0);
     284  virtual ~FitsABTColRead1F();
     285};
     286
     287///////////////////////////////////////////////////////////////////
    189288//! Class for reading a 2D image from a FITS file
    190289class FitsImg2DRd : public AnyDataObj {
Note: See TracChangeset for help on using the changeset viewer.