Ignore:
Timestamp:
Nov 13, 2003, 4:49:45 PM (22 years ago)
Author:
cmv
Message:

Restructuration des fits ecriteur et lecteur:

  • en lecture: lecture des images 2D
  • en ecriture: ecriture des images 2D d'ou restructuration des classes avec heritage sur une class FitWriter

Pour demande DY...

cmv 13/11/2003

File:
1 edited

Legend:

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

    r2451 r2453  
    2828  inline fitsfile* GetFitsPtr() {return FitsPtr;}
    2929
     30  static double ReadKey(fitsfile *fitsptr,char *keyname);
     31  static long   ReadKeyL(fitsfile *fitsptr,char *keyname);
     32  static string ReadKeyS(fitsfile *fitsptr,char *keyname);
     33  static void   printerror(int sta);
     34
    3035protected:
    3136  void Init(const char *cfname);
    3237  void Delete(void);
    33   void printerror(int sta) const;
    3438
    3539  string FitsFN;
     
    121125           ,int ihdu,long blen,long bsens,int lp);
    122126  void Delete(void);
    123   void printerror(int sta) const;
    124127
    125128  string FitsFN,ColLabel,ColTUnit,ColTForm;
     
    158161} // namespace SOPHYA
    159162#endif    /* FABTCOLREAD_H_SEEN */
     163
     164///////////////////////////////////////////////////////////////////
     165//! Class for reading a 2D image from a FITS file
     166class FitsImg2DRd : public AnyDataObj {
     167public:
     168  FitsImg2DRd(FitsOpenFile* fof,int ihdu=0,int lp=0);
     169  FitsImg2DRd(FitsImg2DRd& fbt);
     170  FitsImg2DRd();
     171  virtual ~FitsImg2DRd();
     172
     173  double ReadKey(char *keyname);
     174  long   ReadKeyL(char *keyname);
     175  string ReadKeyS(char *keyname);
     176
     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);
     182
     183  //! Set debug level
     184  inline void    SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
     185  //! Set null value to be return when reading null data (0=return the data)
     186  inline void    SetNulVal(double nulval=0.) {NulVal = nulval;}
     187  //! Get the pointer to FitsOpenFile
     188  inline FitsOpenFile* GetFitsOpenFile(void) {return FitsOF;}
     189  //! Get the number of the HDU read
     190  inline int     GetHDU(void) {return IHdu;}
     191  //! Get the HDU type
     192  inline int     GetHDUType(void) {return HduType;}
     193  //! Get NAXIS1
     194  inline long    GetNaxis1(void) {return Naxis[0];}
     195  //! Get NAXIS2
     196  inline long    GetNaxis2(void) {return Naxis[1];}
     197
     198protected:
     199  void Init(FitsOpenFile* fof,int ihdu,int lp);
     200
     201  string FitsFN;
     202  int IHdu,NHdu,HduType;
     203  long Naxis[2];
     204
     205  double NulVal;
     206  unsigned short DbgLevel;
     207
     208  FitsOpenFile* FitsOF;
     209  fitsfile* FitsPtr;
     210};
Note: See TracChangeset for help on using the changeset viewer.