62 assert ( i < 3 && i >= 0 );
89 if ( bitpix < 5 && bitpix >= 0 ) {
90 type = table [ bitpix ];
125 fits_movabs_hdu (
m_fptr, hdunum + 1,
135 char * extname = const_cast <
char * > ( name.c_str() );
137 fits_movnam_hdu (
m_fptr, ANY_HDU, extname, 0, &m_status );
149 fits_get_hdu_num (
m_fptr, &number );
156 int keyexist, morekeys;
168 fits_read_key(
m_fptr, TDOUBLE,
169 const_cast<char *>(key), &value, 0, &
m_status );
177 char value [ FLEN_VALUE ];
179 fits_read_keyword (
m_fptr, const_cast < char * > ( key ),
191 fits_read_key(
m_fptr, TINT,
192 const_cast<char *>(key), &value, 0, &
m_status );
201 char value [ FLEN_VALUE ];
203 fits_read_key (
m_fptr, TSTRING,
204 const_cast<char *>(key), &value, 0, &
m_status );
206 return string ( value );
226 if ( hdutype == IMAGE_HDU ) {
fitsfile * m_fptr
Pointer to the fits file data structure.
int getImageDimensions() const
Returns the number of dimensions (axes) of an image.
int getHDUNumber() const
Returns the current HDU number.
FitsFileBase(const std::string &filename, bool write=false)
Protected construction taking a file name as argument.
ImageType
The type of image in HDU.
32 bit floating point per pixel
int status() const
Returns the cfitsio status code for the last operation.
ImageType getImageType() const
Returns the image type.
hippodraw::FitsFileBase interface
int m_status
The status return code from the last cfitsio operation.
void clearErrorMessageStack(void)
Clear the entire error message stack.
64 bit floating point per pixel
PyArray_TYPES type(numeric::array arr)
int intValueForKey(const char *key) const
Read a specified keyword value and returns it as a int.
std::string stringValueForKey(const char *key) const
Read a specified keyword value and returns it as a string.
int numKeywords() const
Return the number of existing keywords (not counting the END keyword).
double doubleValueForKey(const char *key) const
Read a specified keyword value and return it as a double.
static HduType convert(int i)
Converts an integer to HduType.
int getNumberOfColumns() const
Returns the number of columns in a table.
HduType getHduType() const
Returns the type of HDU.
int moveToHDU(int hdunum)
Move to a specified absolute HDU number in the FITS file and return the cfitsio status.
int write(const std::vector< double > &a)
Given the vector it writes it to std stream.
virtual ~FitsFileBase()
Virtual destructor.
int getNumberOfHDU() const
Returns the number of HDU in the file.
long getNumberOfRows() const
Returns the number of rows in the table.
bool hasKey(const char *key) const
Returns true if the keyword key exists, otherwise returns false.