/* Interface Fits BINARY/ASCII Table Column Reader cmv 26/09/2001 */ #ifndef FABTCOLREAD_H_SEEN #define FABTCOLREAD_H_SEEN #include "machdefs.h" #include #include #include #include "anydataobj.h" #include "tvector.h" #include "FitsIO/fitsio.h" namespace SOPHYA { //! Class for reading a column in a FITS ASCII or BINARY table class FitsABTColRead : public AnyDataObj { public: FitsABTColRead(string fname,string collabel,int ihdu=0 ,long blen=100,long bsens=1,int lp=0); FitsABTColRead(string fname,int colnum,int ihdu=0 ,long blen=100,long bsens=1,int lp=0); FitsABTColRead(const char *cfname,const char *collabel,int ihdu=0 ,long blen=100,long bsens=1,int lp=0); FitsABTColRead(const char *cfname,int colnum,int ihdu=0 ,long blen=100,long bsens=1,int lp=0); FitsABTColRead(FitsABTColRead& fbt); virtual ~FitsABTColRead(); void ChangeBuffer(long blen=100,long bsens=1); r_8 Read(long n); void Read(long n1,long n2,TVector& data); //! Set debug level inline void SetDebug(int lp=0) {DbgLevel = (uint_2) lp;} //! Set null value to be return when reading null data (0=return the data) inline void SetNulVal(r_8 nulval=0.) {NulVal = nulval;} //! Get the FITS file name inline string GetFileName(void) {return FitsFN;} //! Get the number of HDU in the FITS file inline int GetNHDU(void) {return NHdu;} //! Get the number of the HDU read inline int GetHDU(void) {return IHdu;} //! Get the HDU type inline int GetHDUType(void) {return HduType;} //! Get the number of rows in the FITS HDU to be read inline long GetNbLine(void) {return NBline;} //! Get the number of columns in the FITS HDU to be read inline int GetNbCol(void) {return NBcol;} //! Get the columns number that is read inline int GetColNum(void) {return ColNum;} //! Get the columns label that is read inline string GetColLabel(void) {return ColLabel;} //! Get the columns type code that is read inline int GetColTypeCode(void) {return ColTypeCode;} //! Get the columns fits tunit that is read inline string GetColTUnit(void) {return ColTUnit;} //! Get the columns fits tform that is read inline string GetColTForm(void) {return ColTForm;} //! Get the read buffer length inline long GetBLen(void) {return BuffLen;} //! Get the read buffer direction inline long GetBSens(void) {return BuffSens;} //! Print to os virtual void Print(ostream& os,int lp=1) const; //! Print to stdout inline void Print(int lp=1) const {Print(cout,lp);} //! Get the read buffer effective length inline long GetBufferLen(void) {return NBuffer;} //! Get the read bufferpointer inline double* GetBuffer(void) {return Buffer;} protected: void Init(const char *cfname,const char *collabel,int colnum ,int ihdu,long blen,long bsens,int lp); void Delete(void); void printerror(int sta) const; string FitsFN,ColLabel,ColTUnit,ColTForm; int ColNum,ColTypeCode,IHdu,NHdu,HduType,NBcol; long NBline; r_8 NulVal; uint_2 DbgLevel; long BuffLen, BuffSens; uint_4 NFitsRead; fitsfile *FitsPtr; long LineDeb, LineFin; double *Buffer; long NBuffer; }; } // namespace SOPHYA #endif /* FABTCOLREAD_H_SEEN */