Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

FitsManager Class Reference

Class dedicated to FITS and MEF files management. More...

Inheritance diagram for FitsManager:

DefectixError::ErrorMgr List of all members.

Public Member Functions

 FitsManager (const std::string &fileName, int mode, bool verbose)
 Standard constructor.

 ~FitsManager ()
 Standard destructor.

void copyProperties (FitsManager &src)
 copy properties of a manager to the current manager

void pHDU ()
 go to principal HDU of the MEF

void extHDU (int pos)
 go to an extension HDU of the MEF

void readImage (void **img)
 Read an extension.

void unreadImage (void **img)
 Free an extension.

void setHDUAsImage (int bitpix, const long naxis, const long *axes, const long factor)
 Set the current HDU as an image extension.

void writeImage (void **img)
 Write an extension.

const int getBitpix () const
 Return the current value of the bitpix.

const long getAxis (int i) const
 Return the current value of i-th axis.

const long * getAxes () const
 Return the current value of axes.

const long getNAxes () const
 Return the current number of axes.

const long getNExtend () const
 Return the number of extension in the MEF file.


Private Attributes

fitsfile * _file
 Pointer to the FITS file.

std::string _name
 Name of the FITS file.

int _nextend
 Number of extensions in the MEF file.

int _bitpix
 bitpix of the current extension

int _currentExt
 position of the current extension

int _currentType
 type of the current extension

int _maxdim
 Maximum number of dimensions in the current extension.

int _naxis
 Number of dimensions in the current extension.

long * _naxes
 table containing dimensions of the current extension

long * _fpixel
 table used for cfitsio routines


Detailed Description

Class dedicated to FITS and MEF files management.

The class uses cfitsio library to manage files.


Constructor & Destructor Documentation

FitsManager::FitsManager const std::string &  fileName,
int  mode,
bool  verbose
 

Standard constructor.

Parameters:
fileName Name of the file to open
mode cfitsio opening mode
verbose 

FitsManager::~FitsManager  ) 
 

Standard destructor.

The destructor closes the file and frees used memory.


Member Function Documentation

void FitsManager::copyProperties FitsManager src  ) 
 

copy properties of a manager to the current manager

The function gets every properties of a fits manager and copies them into the current class. The function is usefull for mask creation.

void FitsManager::extHDU int  pos  ) 
 

go to an extension HDU of the MEF

The function sets internal variables to correspond to a given extension of the MEF file.

Parameters:
pos position of the extension in the MEF

const long * FitsManager::getAxes  )  const [inline]
 

Return the current value of axes.

The function returns a pointer to a table containing the value of the axes of the current extension.

const long FitsManager::getAxis int  i  )  const [inline]
 

Return the current value of i-th axis.

The function returns the value of the i-th axis of the current extension.

const int FitsManager::getBitpix  )  const [inline]
 

Return the current value of the bitpix.

The function returns the value of the bitpix of the current extension.

const long FitsManager::getNAxes  )  const [inline]
 

Return the current number of axes.

The function returns the number of axes of the current extension.

void FitsManager::pHDU  ) 
 

go to principal HDU of the MEF

The function sets internal variables to correspond to the pHDU of the MEF file.

void FitsManager::readImage void **  img  ) 
 

Read an extension.

The function reads an extension according to internal values and stores it in the given pointer.

Parameters:
img pointer to store the read image

void FitsManager::setHDUAsImage int  bitpix,
const long  naxis,
const long *  axes,
const long  factor
 

Set the current HDU as an image extension.

The function set internal values so that the current extension is considered to be an image extension. The function is used before an extension is written.

Parameters:
bitpix bitpix to apply to the extension
naxis number of dimensions of the extension
axes values of each dimension
factor rebin factor if the new dimension have to be reduced

void FitsManager::unreadImage void **  img  ) 
 

Free an extension.

The function frees the given pointer.

Parameters:
img pointer to free

void FitsManager::writeImage void **  img  ) 
 

Write an extension.

The function writes an extension according to internal values and the given pointer.

Parameters:
img pointer containing the data to write in the file


Member Data Documentation

long FitsManager::_fpixel [private]
 

table used for cfitsio routines

Must not be used for any other purpose


The documentation for this class was generated from the following file:
Generated on Fri Jul 2 13:08:03 2004 for defectix by doxygen 1.3.5