31#include <CCfits/CCfits>
44 if (dataset_name.
empty()) {
63 auto fits = make_unique<CCfits::FITS>(file, CCfits::RWmode::Read);
64 CCfits::ExtHDU& table_hdu = fits->extension(1);
66 table_hdu.readAllKeys();
67 auto keyword_map = table_hdu.keyWord();
68 auto iter = keyword_map.find(key_word);
69 if (iter != keyword_map.end()) {
70 iter->second->value(value);
84 CCfits::FITS::setVerboseMode(
true);
88 auto fits = make_unique<CCfits::FITS>(file, CCfits::RWmode::Read);
90 const CCfits::ExtHDU& table_hdu = fits->extension(1);
97 return std::make_pair(boost::get<double>(row[0]), boost::get<double>(row[1]));
99 dataset_ptr = make_unique<XYDataset>(
std::move(vector_pair));
100 }
catch (
const CCfits::FitsException&) {
112 bool is_a_dataset_file =
true;
114 auto fits = make_unique<CCfits::FITS>(file, CCfits::RWmode::Read);
115 const CCfits::ExtHDU& table_hdu = fits->extension(1);
116 ELEMENTS_UNUSED auto& temp =
dynamic_cast<const CCfits::Table&
>(table_hdu);
117 }
catch (
const CCfits::FitsException&) {
118 is_a_dataset_file =
false;
120 return is_a_dataset_file;
TableReader implementation for reading FITS tables.
Represents one row of a Table.
Table read(long rows=-1)
Reads next rows as a table.
std::unique_ptr< XYDataset > getDataset(const std::string &file) override
Get a XYDataset object reading data from an FITS file.
std::string getName(const std::string &file) override
Get the dataset name of a FITS file.
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
std::string removeExtension(const std::string &input_str)
std::string removeAllBeforeLastSlash(const std::string &input_str)