![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The namespace of the FITS wrappers More...
Functions | |
std::vector< std::vector< double > > | read_table_fits (const std::string input_fits, const std::vector< std::string > column_names, const int next=1, const double fill_value=cbl::par::defaultDouble) |
function to read a table from a fits file More... | |
void | write_table_fits (const std::string output_dir, const std::string file_fits, const std::vector< std::string > column_names, const std::vector< std::vector< double >> table, const std::vector< std::string > column_units={}) |
function that writes a table on a fits file More... | |
The namespace of the FITS wrappers
The FITS namespace contains all the wrapper functions of the FITS routines.
The CCfits headers are expected to be installed in a subdirectory of the include path. The <CCfits> header file contains all that is necessary to use both the CCfits library and the cfitsio library (for example, it includes fitsio.h), thus making all of cfitsio's macro definitions available.
<CCfits/CCfits> includes 12 of the CCfits headers and will support all CCfits operations. The installed location of the library headers is /include/CCfits to use the library either add -I/include/CCfits or # include <CCfits/CCfits> in the compilation target.
vector< vector< double > > cbl::wrapper::ccfits::read_table_fits | ( | const std::string | input_fits, |
const std::vector< std::string > | column_names, | ||
const int | next = 1 , |
||
const double | fill_value = cbl::par::defaultDouble |
||
) |
function to read a table from a fits file
This function searches for columns indicated in column_names and reads them. If one or more columns are not found in the selected extension, the output is filled with user-defined value(s). If no column is found, an error is raised.
input_fits | name of the input fits file |
column_names | vector containing the columns to read |
next | the number of the extension |
fill_value | if a column is not found, the column vector is filled with the value specified in fill_value; if no column is found, an error is raised |
Definition at line 45 of file FITSwrapper.cpp.
void cbl::wrapper::ccfits::write_table_fits | ( | const std::string | output_dir, |
const std::string | file_fits, | ||
const std::vector< std::string > | column_names, | ||
const std::vector< std::vector< double >> | table, | ||
const std::vector< std::string > | column_units = {} |
||
) |
function that writes a table on a fits file
This function writes columns in a binary table on a FITS file
output_dir | output directory |
file_fits | name of the file fits |
column_names | vector containing the column names to write |
table | vector containing the columns |
column_units | vector containing the column units |
Definition at line 88 of file FITSwrapper.cpp.