Ignore:
Timestamp:
Nov 18, 2003, 1:06:24 AM (22 years ago)
Author:
cmv
Message:

amelioration architecture classe cmv 18/11/03

File:
1 edited

Legend:

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

    r2453 r2456  
    2424  virtual ~FitsOpenFile();
    2525
    26   inline string GetFileName() {return FitsFN;}
    27   inline int GetNHdu() {return NHdu;}
    28   inline fitsfile* GetFitsPtr() {return FitsPtr;}
     26  inline string FileName() const {return FitsFN;}
     27  //! Get the number of the HDU read
     28  inline int HDU(void) const {return IHdu;}
     29  //! Get the number of the HDU type
     30  inline int HDUType(void) const {return HduType;}
     31  //! Get the number of HDU in file
     32  inline int NHDU() const {return NHdu;}
     33  //! Get the CFISTIO fits file pointer
     34  inline fitsfile* GetFitsPtr() const {return FitsPtr;}
     35  //! Set the positionning status of the file
     36  inline void SetPosStatus(bool sta=true) {HasBeenPos = sta;}
     37  //! Get the positionning status of the file
     38  inline bool GetPosStatus(void) const {return HasBeenPos;}
     39
     40  int MoveToHDU(int ihdu);
     41  int MoveToFirst(int hdutype,int ihdudeb=1);
     42  int MoveToLast(int hdutype,int ihdudeb=1);
     43  void Print(void);
    2944
    3045  static double ReadKey(fitsfile *fitsptr,char *keyname);
     
    3853
    3954  string FitsFN;
    40   int NHdu;
     55  int NHdu, IHdu, HduType;
    4156  fitsfile *FitsPtr;
     57  bool HasBeenPos;
    4258};
    4359
     
    6278  double Read(long n,bool usebuffer=true);
    6379
    64   long   Read(long n1,long n2,TVector<uint_2>& data);
    65   long   Read(long n1,long n2,TVector<int_4>& data);
    66   long   Read(long n1,long n2,TVector<int_8>& data);
    67   long   Read(long n1,long n2,TVector<float>& data);
    68   long   Read(long n1,long n2,TVector<double>& data);
     80  long Read(long n1,long n2,TVector<uint_2>& data);
     81  long Read(long n1,long n2,TVector<int_4>& data);
     82  long Read(long n1,long n2,TVector<int_8>& data);
     83  long Read(long n1,long n2,TVector<float>& data);
     84  long Read(long n1,long n2,TVector<double>& data);
    6985
    7086  //! return the value of the first row
     
    7995
    8096  //! Set debug level
    81   inline void    SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
     97  inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
    8298  //! Set null value to be return when reading null data (0=return the data)
    83   inline void    SetNulVal(double nulval=0.) {NulVal = nulval;}
     99  inline void SetNulVal(double nulval=0.) {NulVal = nulval;}
    84100  //! Get the FITS file name
    85   inline string  GetFileName(void) {return FitsFN;}
     101  inline string FileName(void) const
     102         {if(FitsOF) return FitsOF->FileName(); else return (string)"";}
    86103  //! Get the pointer to FitsOpenFile
    87   inline FitsOpenFile* GetFitsOpenFile(void) {return FitsOF;}
     104  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
    88105  //! Get the FITS file pointer (cfistio pointer)
    89   inline fitsfile* GetFitsPointer(void) {return FitsPtr;}
     106  inline fitsfile* GetFitsPtr(void) const {return FitsPtr;}
    90107  //! Get the number of HDU in the FITS file
    91   inline int     GetNHDU(void) {return NHdu;}
     108  inline int NHDU(void) const
     109         {if(FitsOF) return FitsOF->NHDU(); else return 0;}
    92110  //! Get the number of the HDU read
    93   inline int     GetHDU(void) {return IHdu;}
     111  inline int HDU(void) const
     112         {if(FitsOF) return FitsOF->HDU(); else return 0;}
    94113  //! Get the HDU type
    95   inline int     GetHDUType(void) {return HduType;}
     114  inline int HDUType(void) const
     115         {if(FitsOF) return FitsOF->HDUType(); else return 0;}
    96116  //! Get the number of rows in the FITS HDU to be read
    97   inline long    GetNbLine(void) {return NBline;}
     117  inline long GetNbLine(void) const {return NBline;}
    98118  //! Get the number of columns in the FITS HDU to be read
    99   inline int     GetNbCol(void) {return NBcol;}
     119  inline int GetNbCol(void) const {return NBcol;}
    100120  //! Get the columns number that is read
    101   inline int     GetColNum(void) {return ColNum;}
     121  inline int GetColNum(void) const {return ColNum;}
    102122  //! Get the columns label that is read
    103   inline string  GetColLabel(void) {return ColLabel;}
     123  inline string GetColLabel(void) const {return ColLabel;}
    104124  //! Get the columns type code that is read
    105   inline int     GetColTypeCode(void) {return ColTypeCode;}
     125  inline int GetColTypeCode(void) const {return ColTypeCode;}
    106126  //! Get the columns fits tunit that is read
    107   inline string  GetColTUnit(void) {return ColTUnit;}
     127  inline string GetColTUnit(void) const {return ColTUnit;}
    108128  //! Get the columns fits tform that is read
    109   inline string  GetColTForm(void) {return ColTForm;}
     129  inline string GetColTForm(void) const {return ColTForm;}
    110130  //! Get the read requested buffer length
    111   inline long    GetBLen(void) {return BuffLen;}
     131  inline long GetBLen(void) const {return BuffLen;}
    112132  //! Get the read buffer direction
    113   inline long    GetBSens(void) {return BuffSens;}
     133  inline long GetBSens(void) const {return BuffSens;}
    114134  //! Print to os
    115   virtual void   Print(ostream& os,int lp=1) const;
     135  virtual void Print(ostream& os,int lp=1) const;
    116136  //! Print to stdout
    117   inline  void   Print(int lp=1) const {Print(cout,lp);}
     137  inline  void Print(int lp=1) const {Print(cout,lp);}
    118138  //! Get the read effective buffer length
    119   inline long    GetNBuffer(void) {return NBuffer;}
     139  inline long GetNBuffer(void) const {return NBuffer;}
    120140  //! Get the read bufferpointer
    121141  inline double* GetBuffer(void) {return Buffer;}
     
    126146  void Delete(void);
    127147
    128   string FitsFN,ColLabel,ColTUnit,ColTForm;
    129   int ColNum,ColTypeCode,IHdu,NHdu,HduType,NBcol;
     148  string ColLabel,ColTUnit,ColTForm;
     149  int ColNum,ColTypeCode,NBcol;
    130150  long NBline;
    131151
     
    136156  unsigned long NFitsRead;
    137157  FitsOpenFile* FitsOF;
    138   fitsfile* FitsPtr;
     158  fitsfile* FitsPtr; // Redite avec FitsOF->FitsPtr, mais utilise partout!
    139159  long LineDeb, LineFin;
    140160  double *Buffer;
     
    175195  string ReadKeyS(char *keyname);
    176196
    177   long   Read(TMatrix<uint_2>& data);
    178   long   Read(TMatrix<int_4>& data);
    179   long   Read(TMatrix<int_8>& data);
    180   long   Read(TMatrix<float>& data);
    181   long   Read(TMatrix<double>& data);
     197  long Read(TMatrix<uint_2>& data);
     198  long Read(TMatrix<int_4>& data);
     199  long Read(TMatrix<int_8>& data);
     200  long Read(TMatrix<float>& data);
     201  long Read(TMatrix<double>& data);
    182202
    183203  //! Set debug level
     
    186206  inline void    SetNulVal(double nulval=0.) {NulVal = nulval;}
    187207  //! Get the pointer to FitsOpenFile
    188   inline FitsOpenFile* GetFitsOpenFile(void) {return FitsOF;}
     208  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
     209  //! Get the FITS file pointer (cfistio pointer)
     210  inline fitsfile* GetFitsPtr(void) const {return FitsPtr;}
     211  //! Get the number of HDU in the FITS file
     212  inline int NHDU(void) const
     213         {if(FitsOF) return FitsOF->NHDU(); else return 0;}
    189214  //! Get the number of the HDU read
    190   inline int     GetHDU(void) {return IHdu;}
     215  inline int HDU(void) const
     216         {if(FitsOF) return FitsOF->HDU(); else return 0;}
    191217  //! Get the HDU type
    192   inline int     GetHDUType(void) {return HduType;}
     218  inline int HDUType(void) const
     219         {if(FitsOF) return FitsOF->HDUType(); else return 0;}
    193220  //! Get NAXIS1
    194   inline long    GetNaxis1(void) {return Naxis[0];}
     221  inline long Naxis1(void) const {return Naxis[0];}
    195222  //! Get NAXIS2
    196   inline long    GetNaxis2(void) {return Naxis[1];}
     223  inline long Naxis2(void) const {return Naxis[1];}
    197224
    198225protected:
    199226  void Init(FitsOpenFile* fof,int ihdu,int lp);
    200227
    201   string FitsFN;
    202   int IHdu,NHdu,HduType;
    203228  long Naxis[2];
    204 
    205229  double NulVal;
    206230  unsigned short DbgLevel;
    207231
    208232  FitsOpenFile* FitsOF;
    209   fitsfile* FitsPtr;
    210 };
     233  fitsfile* FitsPtr; // Redite avec FitsOF->FitsPtr, mais utilise partout!
     234};
Note: See TracChangeset for help on using the changeset viewer.