1 | /*
|
---|
2 | --- SOPHYA software - FitsIOServer module ---
|
---|
3 | C. Magneville, 2001
|
---|
4 | (C) UPS+LAL IN2P3/CNRS (C) DAPNIA-SPP/CEA
|
---|
5 | */
|
---|
6 | /* Interface Fits BINARY/ASCII Table cmv 21/05/2001 */
|
---|
7 | #ifndef FBTNTINTF_H_SEEN
|
---|
8 | #define FBTNTINTF_H_SEEN
|
---|
9 |
|
---|
10 | #include "machdefs.h"
|
---|
11 | #include <iostream>
|
---|
12 | #include <string.h>
|
---|
13 | #include <string>
|
---|
14 |
|
---|
15 | #include "anydataobj.h"
|
---|
16 | #include "ntupintf.h"
|
---|
17 | #include "FitsIO/fitsio.h"
|
---|
18 |
|
---|
19 | #include <vector>
|
---|
20 |
|
---|
21 | namespace SOPHYA {
|
---|
22 |
|
---|
23 | class FitsBTNtuIntf : public AnyDataObj, public NTupleInterface {
|
---|
24 | public:
|
---|
25 | FitsBTNtuIntf(string fname,int ihdu=0,int_4 blen=100,int_4 bsens=1,uint_2 lp=0);
|
---|
26 | FitsBTNtuIntf(char *cfname,int ihdu=0,int_4 blen=100,int_4 bsens=1,uint_2 lp=0);
|
---|
27 | FitsBTNtuIntf(FitsBTNtuIntf& fbtnt);
|
---|
28 | FitsBTNtuIntf();
|
---|
29 | virtual ~FitsBTNtuIntf();
|
---|
30 |
|
---|
31 | void SetNulVal(r_8 nulval=0.) {NulVal = nulval;}
|
---|
32 | void ChangeBuffer(int_4 blen,int_4 bsens=1);
|
---|
33 | virtual void Print(ostream& os,int lp=1) const;
|
---|
34 | inline void Print(int lp=1) const {Print(cout,lp);}
|
---|
35 |
|
---|
36 | virtual sa_size_t NbLines() const ;
|
---|
37 | virtual sa_size_t NbColumns() const ;
|
---|
38 | virtual r_8 * GetLineD(sa_size_t n) const ;
|
---|
39 | virtual r_8 GetCell( sa_size_t n, sa_size_t k) const ;
|
---|
40 | virtual string VarList_C(const char* nomx=NULL) const ;
|
---|
41 |
|
---|
42 | protected:
|
---|
43 | inline void SetBuffer(int_4 blen=100,int_4 bsens=1)
|
---|
44 | {BuffLen = (blen<=0)?1:blen; BuffSens = bsens;}
|
---|
45 | void DeAllocBuff(void);
|
---|
46 | void AllocBuff(void);
|
---|
47 | void Init(void);
|
---|
48 | void Delete(void);
|
---|
49 | void printerror(int sta) const;
|
---|
50 |
|
---|
51 | string FitsFN;
|
---|
52 | int IHdu;
|
---|
53 | uint_2 DbgLevel;
|
---|
54 | fitsfile *FitsPtr;
|
---|
55 | LONGLONG NBline;
|
---|
56 | int NBcol;
|
---|
57 | r_8 NulVal;
|
---|
58 | int_4 BuffLen, BuffSens;
|
---|
59 | mutable uint_8 NFitsRead;
|
---|
60 | mutable LONGLONG LineDeb, LineFin;
|
---|
61 | vector<string> ColName;
|
---|
62 | bool* ColReadable;
|
---|
63 | double **Buffer;
|
---|
64 | mutable r_8 * mRet;
|
---|
65 | };
|
---|
66 |
|
---|
67 | } // namespace SOPHYA
|
---|
68 | #endif /* FBTNTINTF_H_SEEN */
|
---|