PSFEstimationwithCPSO
|
This class is responsible for managing the input and output FITS files. More...
#include <FitsManager.hpp>
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_result * | nextImage () |
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. |
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:
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.
_n_zernikes | The number of Zernikes in use. |
_img_size | The image width. |
_fft_size | The FFT width. |
obj_filename | The FITS file name for the Object. |
_path_in | The path for the multiple 2D Image FITS files Or the full path for the 3D Image FITS file. |
_path_out | The output path where the output will be stored. |
double * FitsManager::getObject | ( | ) |
Return a reference to the Object data.
fits_result * FitsManager::nextImage | ( | ) |
Return an entry in the buffer containing the next Image to be processed.
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.
result | The buffer entry containing the processing results. |
int FitsManager::size | ( | ) |
Return the number of Images available for this FITS manager.
void FitsManager::startup | ( | int | _bufer_size | ) | [static] |
Initialize the FitsManager.
_bufer_size | The 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.
filename | The FITS file name to save the results. |
ptr | The FITS pointer. |
closeFits | If the file will be closed. |
array | The image data. |
sx | The width of the image. |
sy | The height of the image. |
sz | The 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.
filename | The FITS file name to save the results. |
array | The image data. |
sx | The width of the image. |
sy | The height of the image. |