Alexandria
2.16
Please provide a description of the project.
|
Go to the documentation of this file.
30 #include <boost/regex.hpp>
32 using boost::regex_match;
64 <<
"has started is not allowed";
70 regex whitespace {
".*\\s.*"};
75 if (regex_match(name, whitespace)) {
77 <<
"whitespace characters";
79 if (!set.insert(name).second) {
98 const CCfits::Table& table_hdu =
dynamic_cast<const CCfits::Table&
>(
m_hdu.
get());
107 <<
") does not match the column names number ("
122 const CCfits::Table& table_hdu =
dynamic_cast<const CCfits::Table&
>(
m_hdu.
get());
123 return table_hdu.comment();
138 const CCfits::Table& table_hdu =
dynamic_cast<const CCfits::Table&
>(
m_hdu.
get());
143 for (
int i=1; i<=table_hdu.numCols(); ++i) {
151 for (
int i=0; i<rows; ++i) {
153 for (
const auto& column_data : data) {
159 return Table{row_list};
std::shared_ptr< ColumnInfo > createColumnInfo(const std::vector< std::string > &names, const std::vector< std::type_index > &types, const std::vector< std::string > &units, const std::vector< std::string > &descriptions)
Creates a ColumnInfo object from the given names and types.
const ColumnInfo & getInfo() override
Returns the column information of the table.
std::reference_wrapper< const CCfits::HDU > m_hdu
std::string getComment() override
std::map< std::string, ColumnDescription > autoDetectColumnDescriptions(std::istream &in, const std::string &comment)
Reads the column descriptions of the given stream.
std::vector< Row::cell_type > translateColumn(CCfits::Column &column, std::type_index type)
Returns a vector representing the given FITS table column data, converted to the requested type.
Table readImpl(long rows) override
Implements the TableReader::readImpl() contract.
FitsReader & fixColumnNames(std::vector< std::string > column_names)
Overrides the column names of the table.
FitsReader(const CCfits::HDU &hdu)
Creates a FitsReader that reads from the given HDU.
Provides information about the columns of a Table.
std::size_t rowsLeft() override
Implements the TableReader::rowsLeft() contract.
std::vector< std::string > autoDetectColumnNames(std::istream &in, const std::string &comment, size_t columns_number)
Reads the column names of the given stream.
std::vector< std::string > autoDetectColumnUnits(const CCfits::Table &table_hdu)
Reads the column units based on the TUNITn keyword.
std::unique_ptr< T > make_unique(Args &&... args)
Constructs an object of type T and wraps it in a std::unique_ptr using args as the parameter list for...
std::vector< std::string > m_column_names
TableReader implementation for reading FITS tables.
static CCfits::HDU & _readKeys(CCfits::HDU &hdu)
std::vector< std::type_index > autoDetectColumnTypes(const CCfits::Table &table_hdu)
Reads the column types of the given table HDU.
Represents one row of a Table.
bool hasMoreRows() override
Implements the TableReader::hasMoreRows() contract.
std::shared_ptr< ColumnInfo > m_column_info
void skip(long rows) override
Implements the TableReader::skip() contract.