PSFEstimationwithCPSO
FitsManager Class Reference

This class is responsible for managing the input and output FITS files. More...

#include <FitsManager.hpp>

List of all members.

Public Member Functions

 FitsManager (int _n_zernikes, int _img_area, int _size_fft, char *obj_filename, char *_path_in, char *_path_out)
 Creates a manager to deal with all input and output data.
 ~FitsManager ()
 If a 3D Image FITS file was used as input, it will be saved Only at object destruction time.
void writeFitsFile (char *filename, WORD *array, int sx, int sy)
 Write the image the a FITS file.
void writeFitsFile (char *filename, fits_ptr *ptr, bool closeFits, double *array, int sx, int sy, int sz)
 Write the image the a FITS file.
fits_resultnextImage ()
 Return an entry in the buffer containing the next Image to be processed.
void saveImage (fits_result *result)
 Save the results of the PSF estimation.
double * getObject ()
 Return a reference to the Object data.
int size ()
 Return the number of Images available for this FITS manager.

Static Public Member Functions

static void startup (int _bufer_size)
 Initialize the FitsManager.

Detailed Description

This class is responsible for managing the input and output FITS files.

It accepts as input either a folder containing multiple 2D FITS files Or a single 3D FITS file. The output correspond to the same format as provided by the input, i.e., either multiple 2D outputs Or a single 3D output. For every input file processed, it generates as output 4 files with same file name + a suffix, where each suffix is describe below:

  • _psf.fits: The PSF calculated.
  • _phase.fits: The phase calculated.
  • _conobj.fits: The convolved object calculated.
  • _coefs.txt: The Zernike coefficients calculated.

Constructor & Destructor Documentation

FitsManager::FitsManager ( int  _n_zernikes,
int  _img_size,
int  _fft_size,
char *  obj_filename,
char *  _path_in,
char *  _path_out 
)

Creates a manager to deal with all input and output data.

Parameters:
_n_zernikesThe number of Zernikes in use.
_img_sizeThe image width.
_fft_sizeThe FFT width.
obj_filenameThe FITS file name for the Object.
_path_inThe path for the multiple 2D Image FITS files Or the full path for the 3D Image FITS file.
_path_outThe output path where the output will be stored.

Member Function Documentation

double * FitsManager::getObject ( )

Return a reference to the Object data.

Returns:
A reference to the Object data
fits_result * FitsManager::nextImage ( )

Return an entry in the buffer containing the next Image to be processed.

Returns:
The next Image and all the buffers necessary to store the results.
void FitsManager::saveImage ( fits_result result)

Save the results of the PSF estimation.

If it's dealing with a 2D Image FITS file, the results are saved directly to the disk. If it's a 3D Image FITS file, the results are stored in a secondary buffer, which will be saved Only at destruction moment.

Parameters:
resultThe buffer entry containing the processing results.
int FitsManager::size ( )

Return the number of Images available for this FITS manager.

Returns:
The number of images available.
void FitsManager::startup ( int  _bufer_size) [static]

Initialize the FitsManager.

Parameters:
_bufer_sizeThe buffer size to be used. The default is 1.
void FitsManager::writeFitsFile ( char *  filename,
fits_ptr ptr,
bool  closeFits,
double *  array,
int  sx,
int  sy,
int  sz 
)

Write the image the a FITS file.

If the FITS pointer is NULL, a new pointer will be created and the FITS file, if exists, will be deleted.

Parameters:
filenameThe FITS file name to save the results.
ptrThe FITS pointer.
closeFitsIf the file will be closed.
arrayThe image data.
sxThe width of the image.
syThe height of the image.
szThe number of images to be saved. If this is a 2D image, 1 must be provided.
void FitsManager::writeFitsFile ( char *  filename,
WORD *  array,
int  sx,
int  sy 
)

Write the image the a FITS file.

It converts the data to double, if necessary.

Parameters:
filenameThe FITS file name to save the results.
arrayThe image data.
sxThe width of the image.
syThe height of the image.

The documentation for this class was generated from the following files:
 All Classes Functions