1 | // Guy Le Meur 06/2000
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef FITSBntblLineRW_SEEN
|
---|
5 | #define FITSBntblLineRW_SEEN
|
---|
6 | #include "fitsfile.h"
|
---|
7 | //#include "xntuple.h"
|
---|
8 |
|
---|
9 | namespace SOPHYA {
|
---|
10 | ///////////////////////////////////////////////////////////
|
---|
11 | // Lecture ligne par ligne d'une BINTABLE sur fichier FITS
|
---|
12 | //
|
---|
13 | ///////////////////////////////////////////////////////////
|
---|
14 |
|
---|
15 | class FITS_BntblLineReader : public FitsIOHandler
|
---|
16 | {
|
---|
17 |
|
---|
18 | public:
|
---|
19 | FITS_BntblLineReader();
|
---|
20 | FITS_BntblLineReader(char inputfile[],int hdunum=2);
|
---|
21 | ~FITS_BntblLineReader();
|
---|
22 |
|
---|
23 | BnTblLine& ReadNextLine();
|
---|
24 | inline BnTblLine& GetBnTblLine() {return ligne_;}
|
---|
25 | inline long GetNextLineIndex() const {return nextLineToBeRead_;}
|
---|
26 | inline void SetStartingLineIndex(long n) { nextLineToBeRead_ = n;}
|
---|
27 |
|
---|
28 | inline int status() const {return inFits_->statusF();};
|
---|
29 | inline string GetStatus(int status) const {return inFits_->GetErrStatus(status);};
|
---|
30 |
|
---|
31 |
|
---|
32 |
|
---|
33 | protected:
|
---|
34 |
|
---|
35 | // implementation de FitsIOHandler
|
---|
36 | virtual void ReadFromFits(FitsInFile& is) {};
|
---|
37 | virtual void WriteToFits(FitsOutFile& os) {};
|
---|
38 |
|
---|
39 | private :
|
---|
40 |
|
---|
41 | inline void InitNull()
|
---|
42 | {
|
---|
43 | inFits_ = NULL;
|
---|
44 | nextLineToBeRead_= 0;
|
---|
45 | }
|
---|
46 | // attributs de classe
|
---|
47 |
|
---|
48 | FitsInFile* inFits_;
|
---|
49 | long nextLineToBeRead_;
|
---|
50 | BnTblLine ligne_;
|
---|
51 | };
|
---|
52 |
|
---|
53 |
|
---|
54 | //////////////////////////////////////////////////////////////////
|
---|
55 |
|
---|
56 |
|
---|
57 | class FITS_BntblLineWriter : public FitsIOHandler
|
---|
58 | {
|
---|
59 |
|
---|
60 | public:
|
---|
61 | FITS_BntblLineWriter();
|
---|
62 | FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int cc, vector<string> names, WriteMode wrm = clear);
|
---|
63 | ~FITS_BntblLineWriter();
|
---|
64 | void WriteNextLine( BnTblLine& WorkLine);
|
---|
65 |
|
---|
66 | private :
|
---|
67 |
|
---|
68 | inline void InitNull()
|
---|
69 | {
|
---|
70 | outFits_ = NULL;
|
---|
71 | nextLineToBeWritten_= 0;
|
---|
72 | }
|
---|
73 |
|
---|
74 | protected:
|
---|
75 |
|
---|
76 | // implementation de FitsIOHandler
|
---|
77 | virtual void ReadFromFits(FitsInFile& is) {};
|
---|
78 | virtual void WriteToFits(FitsOutFile& os) {};
|
---|
79 |
|
---|
80 |
|
---|
81 | // attributs de classe
|
---|
82 |
|
---|
83 | FitsOutFile* outFits_;
|
---|
84 | long nextLineToBeWritten_;
|
---|
85 | BnTblLine ligne_;
|
---|
86 | };
|
---|
87 |
|
---|
88 |
|
---|
89 | } // Fin du namespace
|
---|
90 |
|
---|
91 | #endif
|
---|