26 #include <boost/regex.hpp> 29 #include <CCfits/CCfits> 39 using boost::regex_match;
50 if (dataset_name.
empty()){
56 return (dataset_name);
71 CCfits::ExtHDU& table_hdu = fits->extension(1);
73 table_hdu.readAllKeys();
74 auto keyword_map = table_hdu.keyWord();
75 auto iter=keyword_map.find(key_word);
76 if (iter != keyword_map.end()) {
77 iter->second->value(value);
91 CCfits::FITS::setVerboseMode(
true);
97 const CCfits::ExtHDU& table_hdu = fits->extension(1);
103 for (
auto row : table) {
108 catch (CCfits::FitsException& fits_except){
120 bool is_a_dataset_file =
true;
123 const CCfits::ExtHDU& table_hdu = fits->extension(1);
124 ELEMENTS_UNUSED auto& temp = dynamic_cast<const CCfits::Table&>(table_hdu);
126 catch (CCfits::FitsException& fits_except){
127 is_a_dataset_file =
false;
129 return is_a_dataset_file;
std::string removeAllBeforeLastSlash(const std::string &input_str)
bool isDatasetFile(const std::string &file) override
Check that the FITS file is a dataset file(with at least one HDU table)
std::string getParameter(const std::string &file, const std::string &key_word) override
Get the parameter identified by a given key_word value from a file.
std::string m_name_keyword
Table read(long rows=-1)
Reads next rows as a table.
std::string removeExtension(const std::string &input_str)
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
TableReader implementation for reading FITS tables.
std::string getName(const std::string &file) override
Get the dataset name of a FITS file.
std::unique_ptr< XYDataset > getDataset(const std::string &file) override
Get a XYDataset object reading data from an FITS file.