Alexandria  2.25.0
SDC-CH common library for the Euclid project
FitsReaderHelper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2022 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 3.0 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
25 #ifndef FITSREADERHELPER_H
26 #define FITSREADERHELPER_H
27 
28 #include <CCfits/CCfits>
29 #include <string>
30 #include <typeindex>
31 #include <vector>
32 
33 #include "ElementsKernel/Export.h"
34 
35 #include "Table/Row.h"
36 
37 namespace Euclid {
38 namespace Table {
39 
49 ELEMENTS_API std::vector<std::string> autoDetectColumnNames(const CCfits::Table& table_hdu);
50 
64 
66 ELEMENTS_API std::vector<std::string> autoDetectColumnUnits(const CCfits::Table& table_hdu);
67 
70 
84 
85 ELEMENTS_API std::vector<Row::cell_type> translateColumn(CCfits::Column& column, std::type_index type, long first,
86  long last);
87 
88 } // namespace Table
89 } // end of namespace Euclid
90 
91 #endif /* FITSREADERHELPER_H */
#define ELEMENTS_API
std::map< std::string, ColumnDescription > autoDetectColumnDescriptions(std::istream &in, const std::string &comment)
Reads the column descriptions of the given stream.
std::vector< std::string > autoDetectColumnUnits(const CCfits::Table &table_hdu)
Reads the column units based on the TUNITn keyword.
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< 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.
std::vector< std::pair< std::type_index, std::size_t > > autoDetectColumnTypes(const CCfits::Table &table_hdu)
Reads the column types of the given table HDU.