[860] | 1 | // Guy Le Meur 03/2000
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | #ifndef FITSXNTuple_SEEN
|
---|
| 5 | #define FITSXNTuple_SEEN
|
---|
| 6 | #include "xntuple.h"
|
---|
| 7 | #include "anydataobj.h"
|
---|
| 8 | #include "ppersist.h"
|
---|
| 9 | #include "fitsfile.h"
|
---|
| 10 |
|
---|
| 11 | namespace SOPHYA {
|
---|
| 12 | ///////////////////////////////////////////////////////////
|
---|
| 13 | // Les objets delegues pour la gestion de persistance sur fichiers fits
|
---|
| 14 | // pour XNTuple
|
---|
| 15 | ///////////////////////////////////////////////////////////
|
---|
| 16 |
|
---|
| 17 | class FITS_XNTuple : public FitsFile
|
---|
| 18 | {
|
---|
| 19 |
|
---|
| 20 | public:
|
---|
| 21 | FITS_XNTuple();
|
---|
| 22 | FITS_XNTuple(char inputfile[],int hdunum=2);
|
---|
| 23 | FITS_XNTuple(const XNTuple & obj);
|
---|
[1047] | 24 | FITS_XNTuple(XNTuple* obj);
|
---|
[860] | 25 | ~FITS_XNTuple();
|
---|
[1047] | 26 | void Read(char inputfile[],int hdunum=2);
|
---|
| 27 |
|
---|
| 28 | /*!
|
---|
| 29 | fill the XNTuple only with lines from firstLine-th to (firstLine+numberOfLines-1)-th of the FITS-file inputfile.
|
---|
| 30 | \param <firstLine> first line to be read (the first line of the file is numbered 0)
|
---|
| 31 | \param <numberOfLines> number of lines to be read
|
---|
| 32 | */
|
---|
| 33 | void ReadLines(char inputfile[],int firstLine, int numberOfLines,int hdunum=2);
|
---|
[972] | 34 | void Write(char outputfile[], bool OldFile=false);
|
---|
[860] | 35 | inline operator XNTuple() { return(*dobj_); }
|
---|
[1049] | 36 | inline XNTuple * getObj() { return(dobj_); }
|
---|
[860] | 37 |
|
---|
| 38 | protected:
|
---|
| 39 |
|
---|
| 40 | // implementation de FitsFile
|
---|
[1047] | 41 | // virtual void ReadFromFits(FitsFile& fn);
|
---|
| 42 | virtual void ReadFromFits();
|
---|
| 43 | virtual void WriteToFits();
|
---|
[860] | 44 | void* getColFromObj(int colNr);
|
---|
| 45 | double* getColDFromObj(int colNr);
|
---|
| 46 | float* getColFFromObj(int colNr);
|
---|
| 47 | int* getColIFromObj(int colNr);
|
---|
| 48 | char** getColSFromObj(int colNr);
|
---|
| 49 |
|
---|
[1047] | 50 | private :
|
---|
| 51 |
|
---|
| 52 | void Clean();
|
---|
| 53 |
|
---|
| 54 | inline void InitNull()
|
---|
| 55 | {
|
---|
| 56 | fistLineToBeRead_= -1;
|
---|
| 57 | numberOfLinesToBeRead_= -1;
|
---|
| 58 | dcolumn_ = NULL;
|
---|
| 59 | fcolumn_ = NULL;
|
---|
| 60 | icolumn_ = NULL;
|
---|
| 61 | ccolumn_ = NULL;
|
---|
| 62 | }
|
---|
| 63 |
|
---|
[860] | 64 | // attributs de classe
|
---|
| 65 | XNTuple* dobj_;
|
---|
[1047] | 66 | bool ownobj_;
|
---|
| 67 | int fistLineToBeRead_;
|
---|
| 68 | int numberOfLinesToBeRead_;
|
---|
[860] | 69 | double* dcolumn_;
|
---|
| 70 | float* fcolumn_;
|
---|
| 71 | int* icolumn_;
|
---|
| 72 | char** ccolumn_;
|
---|
| 73 | };
|
---|
| 74 | //////////////////////////////////////////////////////////////////
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | } // Fin du namespace
|
---|
| 78 |
|
---|
| 79 | #endif
|
---|