Changeset 2456 in Sophya for trunk/SophyaExt/FitsIOServer/fabtcolread.h
- Timestamp:
- Nov 18, 2003, 1:06:24 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.h
r2453 r2456 24 24 virtual ~FitsOpenFile(); 25 25 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); 29 44 30 45 static double ReadKey(fitsfile *fitsptr,char *keyname); … … 38 53 39 54 string FitsFN; 40 int NHdu ;55 int NHdu, IHdu, HduType; 41 56 fitsfile *FitsPtr; 57 bool HasBeenPos; 42 58 }; 43 59 … … 62 78 double Read(long n,bool usebuffer=true); 63 79 64 long 65 long 66 long 67 long 68 long 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); 69 85 70 86 //! return the value of the first row … … 79 95 80 96 //! Set debug level 81 inline void 97 inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;} 82 98 //! Set null value to be return when reading null data (0=return the data) 83 inline void 99 inline void SetNulVal(double nulval=0.) {NulVal = nulval;} 84 100 //! 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)"";} 86 103 //! Get the pointer to FitsOpenFile 87 inline FitsOpenFile* GetFitsOpenFile(void) {return FitsOF;}104 inline FitsOpenFile* GetFitsOpenFile(void) const {return FitsOF;} 88 105 //! Get the FITS file pointer (cfistio pointer) 89 inline fitsfile* GetFitsP ointer(void){return FitsPtr;}106 inline fitsfile* GetFitsPtr(void) const {return FitsPtr;} 90 107 //! 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;} 92 110 //! 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;} 94 113 //! 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;} 96 116 //! 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;} 98 118 //! 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;} 100 120 //! Get the columns number that is read 101 inline int GetColNum(void){return ColNum;}121 inline int GetColNum(void) const {return ColNum;} 102 122 //! Get the columns label that is read 103 inline string GetColLabel(void){return ColLabel;}123 inline string GetColLabel(void) const {return ColLabel;} 104 124 //! Get the columns type code that is read 105 inline int GetColTypeCode(void){return ColTypeCode;}125 inline int GetColTypeCode(void) const {return ColTypeCode;} 106 126 //! Get the columns fits tunit that is read 107 inline string GetColTUnit(void){return ColTUnit;}127 inline string GetColTUnit(void) const {return ColTUnit;} 108 128 //! Get the columns fits tform that is read 109 inline string GetColTForm(void){return ColTForm;}129 inline string GetColTForm(void) const {return ColTForm;} 110 130 //! Get the read requested buffer length 111 inline long GetBLen(void){return BuffLen;}131 inline long GetBLen(void) const {return BuffLen;} 112 132 //! Get the read buffer direction 113 inline long GetBSens(void){return BuffSens;}133 inline long GetBSens(void) const {return BuffSens;} 114 134 //! Print to os 115 virtual void 135 virtual void Print(ostream& os,int lp=1) const; 116 136 //! Print to stdout 117 inline void 137 inline void Print(int lp=1) const {Print(cout,lp);} 118 138 //! Get the read effective buffer length 119 inline long GetNBuffer(void){return NBuffer;}139 inline long GetNBuffer(void) const {return NBuffer;} 120 140 //! Get the read bufferpointer 121 141 inline double* GetBuffer(void) {return Buffer;} … … 126 146 void Delete(void); 127 147 128 string FitsFN,ColLabel,ColTUnit,ColTForm;129 int ColNum,ColTypeCode, IHdu,NHdu,HduType,NBcol;148 string ColLabel,ColTUnit,ColTForm; 149 int ColNum,ColTypeCode,NBcol; 130 150 long NBline; 131 151 … … 136 156 unsigned long NFitsRead; 137 157 FitsOpenFile* FitsOF; 138 fitsfile* FitsPtr; 158 fitsfile* FitsPtr; // Redite avec FitsOF->FitsPtr, mais utilise partout! 139 159 long LineDeb, LineFin; 140 160 double *Buffer; … … 175 195 string ReadKeyS(char *keyname); 176 196 177 long 178 long 179 long 180 long 181 long 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); 182 202 183 203 //! Set debug level … … 186 206 inline void SetNulVal(double nulval=0.) {NulVal = nulval;} 187 207 //! 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;} 189 214 //! 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;} 191 217 //! 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;} 193 220 //! Get NAXIS1 194 inline long GetNaxis1(void){return Naxis[0];}221 inline long Naxis1(void) const {return Naxis[0];} 195 222 //! Get NAXIS2 196 inline long GetNaxis2(void){return Naxis[1];}223 inline long Naxis2(void) const {return Naxis[1];} 197 224 198 225 protected: 199 226 void Init(FitsOpenFile* fof,int ihdu,int lp); 200 227 201 string FitsFN;202 int IHdu,NHdu,HduType;203 228 long Naxis[2]; 204 205 229 double NulVal; 206 230 unsigned short DbgLevel; 207 231 208 232 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.