Ignore:
Timestamp:
Dec 13, 2006, 6:44:39 PM (19 years ago)
Author:
cmv
Message:

1-/ intro des reader et writer pour tableaux 3D
2-/ j enleve la variable redondante FitsPtr :

si travail OK c est une modif mineure
mais ca peut conduire a de gros PB si qquechose a ete oublie
ATTENTION ATTENTION MODIF .... cmv 13/12/2006

File:
1 edited

Legend:

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

    r2791 r3114  
    104104  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
    105105  //! Get the FITS file pointer (cfistio pointer)
    106   inline fitsfile* GetFitsPtr(void) const {return FitsPtr;}
     106  inline fitsfile* GetFitsPtr(void) const {return FitsOF->GetFitsPtr();}
    107107  //! Get the number of HDU in the FITS file
    108108  inline int NHDU(void) const
     
    156156  unsigned long NFitsRead;
    157157  FitsOpenFile* FitsOF;
    158   fitsfile* FitsPtr; // Redite avec FitsOF->FitsPtr, mais utilise partout!
    159158  long LineDeb, LineFin;
    160159  double *Buffer;
     
    193192  string ReadKeyS(char *keyname);
    194193
    195   long Read(TMatrix<uint_2>& data);
    196   long Read(TMatrix<int_4>& data);
    197   long Read(TMatrix<int_8>& data);
    198   long Read(TMatrix<float>& data);
    199   long Read(TMatrix<double>& data);
     194  size_t Read(TMatrix<uint_2>& data);
     195  size_t Read(TMatrix<int_4>& data);
     196  size_t Read(TMatrix<int_8>& data);
     197  size_t Read(TMatrix<float>& data);
     198  size_t Read(TMatrix<double>& data);
    200199
    201200  //! Set debug level
     
    206205  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
    207206  //! Get the FITS file pointer (cfistio pointer)
    208   inline fitsfile* GetFitsPtr(void) const {return FitsPtr;}
     207  inline fitsfile* GetFitsPtr(void) const {return FitsOF->GetFitsPtr();}
    209208  //! Get the number of HDU in the FITS file
    210209  inline int NHDU(void) const
     
    229228
    230229  FitsOpenFile* FitsOF;
    231   fitsfile* FitsPtr; // Redite avec FitsOF->FitsPtr, mais utilise partout!
    232230};
    233231
     
    243241};
    244242
     243
     244///////////////////////////////////////////////////////////////////
     245//! Class for reading a 3D image from a FITS file
     246class FitsImg3DRd : public AnyDataObj {
     247public:
     248  FitsImg3DRd(FitsOpenFile* fof,int ihdu=0,int lp=0);
     249  FitsImg3DRd(FitsImg3DRd& fbt);
     250  FitsImg3DRd();
     251  virtual ~FitsImg3DRd();
     252
     253  double ReadKey(char *keyname);
     254  long   ReadKeyL(char *keyname);
     255  string ReadKeyS(char *keyname);
     256
     257  size_t Read(TArray<uint_2>& data);
     258  size_t Read(TArray<int_4>& data);
     259  size_t Read(TArray<int_8>& data);
     260  size_t Read(TArray<float>& data);
     261  size_t Read(TArray<double>& data);
     262
     263  //! Set debug level
     264  inline void    SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
     265  //! Set null value to be return when reading null data (0=return the data)
     266  inline void    SetNulVal(double nulval=0.) {NulVal = nulval;}
     267  //! Get the pointer to FitsOpenFile
     268  inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;}
     269  //! Get the FITS file pointer (cfistio pointer)
     270  inline fitsfile* GetFitsPtr(void) const {return FitsOF->GetFitsPtr();}
     271  //! Get the number of HDU in the FITS file
     272  inline int NHDU(void) const
     273         {if(FitsOF) return FitsOF->NHDU(); else return 0;}
     274  //! Get the number of the HDU read
     275  inline int HDU(void) const
     276         {if(FitsOF) return FitsOF->HDU(); else return 0;}
     277  //! Get the HDU type
     278  inline int HDUType(void) const
     279         {if(FitsOF) return FitsOF->HDUType(); else return 0;}
     280  //! Get NAXIS1
     281  inline long Naxis1(void) const {return Naxis[0];}
     282  //! Get NAXIS2
     283  inline long Naxis2(void) const {return Naxis[1];}
     284  //! Get NAXIS3
     285  inline long Naxis3(void) const {return Naxis[2];}
     286
     287protected:
     288  void Init(FitsOpenFile* fof,int ihdu,int lp);
     289
     290  long Naxis[3];
     291  double NulVal;
     292  unsigned short DbgLevel;
     293
     294  FitsOpenFile* FitsOF;
     295};
     296
     297///////////////////////////////////////////////////////////////////
     298//! Class for reading a 3D image from a FITS file
     299class FitsImg3DRead : public FitsImg3DRd {
     300public:
     301  FitsImg3DRead(string fname,int ihdu=0,int lp=0);
     302  FitsImg3DRead(const char *cfname,int ihdu=0,int lp=0);
     303  FitsImg3DRead(FitsImg3DRead& fbt);
     304  FitsImg3DRead();
     305  virtual ~FitsImg3DRead();
     306};
     307
    245308} // namespace SOPHYA
    246309#endif    /* FABTCOLREAD_H_SEEN */
Note: See TracChangeset for help on using the changeset viewer.