ddt 1.2.1
|
#include <dataFile.hpp>
Protected Attributes | |
ddt::DdtLogger * | logger |
DataFile () | |
virtual | ~DataFile () |
void | set_logger (ddt::DdtLogger *logger) |
bool | OpenFile (const std::string &filename, const int position=0) |
cpl_vector * | OpenAndLoadVector (const std::string &file_name, const int position=0) |
cpl_image * | OpenAndLoadImage (const std::string &file_name, const int position=0) |
cpl_image * | OpenAndLoadCube (const std::string &file_name, const int plane_number=0, const int position=0) |
cpl_vector * | LoadVector () |
cpl_image * | LoadImage (const int plane_number=0) |
cpl_table * | LoadBinaryTable (const int extension_number) |
cpl_propertylist * | LoadPropertyList () |
cpl_wcs * | LoadWCS () |
cpl_image * | LoadImageExtensionsAsOne (const int plane_number=0) |
int | get_FilePosition () const |
std::string | get_FileName () const |
int | get_NumberAxis () const |
int | get_NumberPlanes () const |
int | get_NumberExtensions () const |
int | get_ImageWidth () const |
int | get_ImageHeight () const |
bool | get_IsVector () const |
bool | get_IsImage () const |
bool | get_IsCube () const |
bool | get_IsBintable () const |
FitsExtension * | get_FitsExtensionInfo (const int extension_number) |
FitsExtension | get_PrimaryHDUInfo () const |
std::vector< int > | get_invalid_image_hdus () const |
Class to wrap the usage of FITS file functions.
This class offers access to FITS files, using functions from the CPL library. The files are opened and the properties are read. According to the contained data (number of axis), various functions are available to load the 1D, 2D or 3D data.
DataFile::DataFile | ( | ) |
Constructor
|
virtualdefault |
Destructor
std::string DataFile::get_FileName | ( | ) | const |
Get the current file name
int DataFile::get_FilePosition | ( | ) | const |
Get the current file position (extension; number of HDU opened (0: first))
FitsExtension * DataFile::get_FitsExtensionInfo | ( | const int | extension_number | ) |
Get the information about one file extension
extension_number | the extension number |
int DataFile::get_ImageHeight | ( | ) | const |
Get the image height (number of y pixels)
int DataFile::get_ImageWidth | ( | ) | const |
Get the image width (number of x pixels)
std::vector< int > DataFile::get_invalid_image_hdus | ( | ) | const |
Get the information about invalid image HDUs
bool DataFile::get_IsBintable | ( | ) | const |
Get the flag indicating if the image contains a binary table
Get the flag indicating if the image contains a binary table
bool DataFile::get_IsCube | ( | ) | const |
Get the flag indicating if the image contains cube data
bool DataFile::get_IsImage | ( | ) | const |
Get the flag indicating if the image contains image data
bool DataFile::get_IsVector | ( | ) | const |
Get the flag indicating if the image contains vector data
int DataFile::get_NumberAxis | ( | ) | const |
Get the number of axis (vector data: 1, image data: 2, cube data: 3)
int DataFile::get_NumberExtensions | ( | ) | const |
Get the number of extensions contained in the image
Get the number of extensions
int DataFile::get_NumberPlanes | ( | ) | const |
Get the number of planes (relevant only for a 3D image)
FitsExtension DataFile::get_PrimaryHDUInfo | ( | ) | const |
Get the information about the primary HDU
cpl_table * DataFile::LoadBinaryTable | ( | const int | extension_number | ) |
Load a binary table as cpl_table from one of the image extensions. Note that the file has to be opened before using OpenFile() function, but not necessarily with the desired extension.
extension_number | the extension number |
cpl_image * DataFile::LoadImage | ( | const int | plane_number = 0 | ) |
Load image data. Note that the file has to be opened before using OpenFile() function.
plane_number | number of plane to load. This defaults to 0 (the only option for 2D images), which means the first plane. |
cpl_image * DataFile::LoadImageExtensionsAsOne | ( | const int | plane_number = 0 | ) |
Load image data extensions into one cpl_image. Note that the file has to be opened before using OpenFile() function.
plane_number | number of plane to load. This defaults to 0 (the only option for 2D images), which means the first plane. |
cpl_propertylist * DataFile::LoadPropertyList | ( | ) |
Load the CPL property list from the file. The returned object must be destroyed using cpl_propertylist_delete().
cpl_vector * DataFile::LoadVector | ( | ) |
Load vector data. Note that the file has to be opened before using OpenFile() function.
cpl_wcs * DataFile::LoadWCS | ( | ) |
Load the CPL WCS object from the file's property list. The returned object must be destroyed using cpl_wcs_delete().
cpl_image * DataFile::OpenAndLoadCube | ( | const std::string & | file_name, |
const int | plane_number = 0, | ||
const int | position = 0 ) |
Open file and load image data. This function takes a CPL file (FITS) name and a position. The position indicates the HDU to use. The default HDU is the first (position 0). The function first opens the file and checks the image properties. If the file contains cube data (number of axis = 3), the image data of the specified plane is loaded.
file_name | |
plane_number | number of plane to load. This defaults to 0, meaning the first plane. |
position | the position indicating the HDU to use. This defaults to 0 (the first HDU). |
cpl_image * DataFile::OpenAndLoadImage | ( | const std::string & | file_name, |
const int | position = 0 ) |
Open file and load image data. This function takes a CPL file (FITS) name and a position. The position indicates the HDU to use. The default HDU is the first (position 0). The function first opens the file and checks the image properties. If the file contains image data (number of axis = 2), the image data is loaded.
file_name | |
position | the position indicating the HDU to use. This defaults to 0 (the first HDU). |
cpl_vector * DataFile::OpenAndLoadVector | ( | const std::string & | file_name, |
const int | position = 0 ) |
Open file and load vector data. This function takes a CPL file (FITS) name and a position. The position indicates the HDU to use. The default HDU is the first (position 0). The function first opens the file and checks the image properties. If the file contains vector data (number of axis = 1), the vector data is loaded.
file_name | |
position | the position indicating the HDU to use. This defaults to 0 (the first HDU). |
bool DataFile::OpenFile | ( | const std::string & | filename, |
const int | position = 0 ) |
Open file. This function takes a CPL file (FITS) name and a position. The position indicates the HDU to use. The default HDU is the first (position 0). The function reads the property list of the file and checks the number of axis in the file and the image dimensions. This information can be retrieved by the corresponding functions in order to load the image rsp. vector data.
filename | the FITS file name to load |
position | the position indicating the HDU to use. This defaults to 0 (the first HDU). |
void DataFile::set_logger | ( | ddt::DdtLogger * | logger | ) |
Set logger
logger | A DDT logger object (no transfer of ownership). |
|
protected |
The logger object