source: Sophya/trunk/SophyaExt/FitsIOServer/fabtcolread.h@ 1657

Last change on this file since 1657 was 1657, checked in by cmv, 24 years ago

possibilite d'ecrire directement des TVector fabtwriter cmv 27/9/01

File size: 3.3 KB
RevLine 
[1654]1/* Interface Fits BINARY/ASCII Table Column Reader cmv 26/09/2001 */
2#ifndef FABTCOLREAD_H_SEEN
3#define FABTCOLREAD_H_SEEN
4
5#include "machdefs.h"
6#include <iostream.h>
7#include <string.h>
8#include <string>
9
10#include "anydataobj.h"
11#include "tvector.h"
12#include "FitsIO/fitsio.h"
13
14namespace SOPHYA {
15
16//! Class for reading a column in a FITS ASCII or BINARY table
17class FitsABTColRead : public AnyDataObj {
18public:
19 FitsABTColRead(string fname,string collabel,int ihdu=0
20 ,long blen=100,long bsens=1,int lp=0);
21 FitsABTColRead(string fname,int colnum,int ihdu=0
22 ,long blen=100,long bsens=1,int lp=0);
23 FitsABTColRead(const char *cfname,const char *collabel,int ihdu=0
24 ,long blen=100,long bsens=1,int lp=0);
25 FitsABTColRead(const char *cfname,int colnum,int ihdu=0
26 ,long blen=100,long bsens=1,int lp=0);
27 FitsABTColRead(FitsABTColRead& fbt);
28 virtual ~FitsABTColRead();
29
30 void ChangeBuffer(long blen=100,long bsens=1);
31
[1657]32 double Read(long n);
33 void Read(long n1,long n2,TVector<double>& data);
[1654]34
35 //! Set debug level
[1657]36 inline void SetDebug(int lp=0) {DbgLevel = (unsigned short) lp;}
[1654]37 //! Set null value to be return when reading null data (0=return the data)
[1657]38 inline void SetNulVal(double nulval=0.) {NulVal = nulval;}
[1654]39 //! Get the FITS file name
40 inline string GetFileName(void) {return FitsFN;}
41 //! Get the number of HDU in the FITS file
42 inline int GetNHDU(void) {return NHdu;}
43 //! Get the number of the HDU read
44 inline int GetHDU(void) {return IHdu;}
45 //! Get the HDU type
46 inline int GetHDUType(void) {return HduType;}
47 //! Get the number of rows in the FITS HDU to be read
48 inline long GetNbLine(void) {return NBline;}
49 //! Get the number of columns in the FITS HDU to be read
50 inline int GetNbCol(void) {return NBcol;}
51 //! Get the columns number that is read
52 inline int GetColNum(void) {return ColNum;}
53 //! Get the columns label that is read
54 inline string GetColLabel(void) {return ColLabel;}
55 //! Get the columns type code that is read
56 inline int GetColTypeCode(void) {return ColTypeCode;}
57 //! Get the columns fits tunit that is read
58 inline string GetColTUnit(void) {return ColTUnit;}
59 //! Get the columns fits tform that is read
60 inline string GetColTForm(void) {return ColTForm;}
[1657]61 //! Get the read requested buffer length
[1654]62 inline long GetBLen(void) {return BuffLen;}
63 //! Get the read buffer direction
64 inline long GetBSens(void) {return BuffSens;}
65 //! Print to os
66 virtual void Print(ostream& os,int lp=1) const;
67 //! Print to stdout
68 inline void Print(int lp=1) const {Print(cout,lp);}
[1657]69 //! Get the read effective buffer length
70 inline long GetNBuffer(void) {return NBuffer;}
[1654]71 //! Get the read bufferpointer
72 inline double* GetBuffer(void) {return Buffer;}
73
74protected:
75 void Init(const char *cfname,const char *collabel,int colnum
76 ,int ihdu,long blen,long bsens,int lp);
77 void Delete(void);
78 void printerror(int sta) const;
79
80 string FitsFN,ColLabel,ColTUnit,ColTForm;
81 int ColNum,ColTypeCode,IHdu,NHdu,HduType,NBcol;
82 long NBline;
83
[1657]84 double NulVal;
85 unsigned short DbgLevel;
[1654]86 long BuffLen, BuffSens;
87
[1657]88 unsigned long NFitsRead;
[1654]89 fitsfile *FitsPtr;
90 long LineDeb, LineFin;
91 double *Buffer;
92 long NBuffer;
93};
94
95} // namespace SOPHYA
96#endif /* FABTCOLREAD_H_SEEN */
Note: See TracBrowser for help on using the repository browser.