00001
00002
00014 #include "fitsio.h"
00015
00016 #include <string>
00017
00027 class FitsFileBase {
00028
00029 public:
00030
00033 enum HduType
00034 { Image = IMAGE_HDU,
00035 Atable = ASCII_TBL,
00036 Btable = BINARY_TBL,
00037 Any = ANY_HDU
00038 };
00039
00042 enum ImageType
00043 { ByteImg = BYTE_IMG,
00044 ShortImg = SHORT_IMG,
00045 LongImg = LONG_IMG,
00046 FloatImg = FLOAT_IMG,
00047 DoubleImg = DOUBLE_IMG,
00048 NoImg = 0,
00049 };
00050
00053 enum DataType {
00054 ByteU = TBYTE,
00055 Short = TSHORT,
00056 ShortU = TUSHORT,
00057 Int = TINT,
00058 IntU = TUINT,
00059 Long = TLONG,
00060 LongU = TULONG,
00061 LongLong = TLONGLONG,
00062 Float = TFLOAT,
00063 Double = TDOUBLE
00064 };
00065
00066
00067 private:
00068
00071 static HduType convert ( int i );
00072
00073 protected:
00074
00077 mutable int m_status;
00078
00080 fitsfile *m_fptr;
00081
00083 FitsFileBase ( const std::string & filename );
00084
00087 ImageType getImageType () const;
00088
00091 int getImageDimensions ( ) const;
00092
00093 public:
00094
00096 virtual ~FitsFileBase();
00097
00099 void clearErrorMessageStack( void );
00100
00103 HduType getHduType () const;
00104
00107 int getNumberOfHDU () const;
00108
00112 int getHDUNumber ( ) const;
00113
00121 int moveToHDU ( int hdunum );
00122
00128 int moveToHDU ( const std::string & name );
00129
00135 int moveByHDU ( int n );
00136
00141 int numKeywords() const;
00142
00145 bool hasKey ( const char * key ) const;
00146
00153 double doubleValueForKey ( const char * key ) const;
00154
00155
00161 int intValueForKey( const char * key ) const;
00162
00169 std::string stringValueForKey ( const char * key ) const;
00170
00172 void printKeywordRecords() const;
00173
00176 int printNumberKeywords() const;
00177
00180 int status () const;
00181
00184 long getNumberOfRows ( ) const;
00185
00188 int getNumberOfColumns ( ) const;
00189
00190 private:
00191
00193 FitsFileBase( const FitsFileBase& );
00194
00196 FitsFileBase& operator=( const FitsFileBase&);
00197
00198 };