SourceXtractorPlusPlus
0.16
Please provide a description of the project.
SEImplementation
src
lib
PythonConfig
PyFitsFile.cpp
Go to the documentation of this file.
1
18
#include "
SEUtils/VariantCast.h
"
19
#include <
SEImplementation/PythonConfig/PyFitsFile.h
>
20
#include <boost/algorithm/string.hpp>
21
22
namespace
SourceXtractor
{
23
24
PyFitsFile::PyFitsFile
(
const
std::string
&
filename
) : m_filename(
filename
) {
25
m_file
= std::make_shared<FitsFile>(
filename
,
false
);
26
}
27
28
std::vector<int>
PyFitsFile::getImageHdus
()
const
{
29
std::vector<int>
v;
30
31
for
(
auto
num :
m_file
->getImageHdus()) {
32
v.
push_back
(num-1);
33
}
34
35
return
v;
36
}
37
38
std::map<std::string, std::string>
PyFitsFile::getHeaders
(
int
hdu)
const
{
39
const
auto
& headers =
m_file
->getHDUHeaders(hdu+1);
40
std::map<std::string, std::string>
headers_str;
41
42
for
(
auto
& i : headers) {
43
auto
key = i.first;
44
auto
value = VariantCast<std::string>(i.second.m_value);
45
boost::trim(key);
46
boost::trim(value);
47
headers_str[key] = value;
48
}
49
50
return
headers_str;
51
}
52
53
}
PyFitsFile.h
VariantCast.h
std::string
SourceXtractor::PyFitsFile::m_file
std::shared_ptr< FitsFile > m_file
Definition:
PyFitsFile.h:46
SourceXtractor::PyFitsFile::getHeaders
std::map< std::string, std::string > getHeaders(int hdu) const
Definition:
PyFitsFile.cpp:38
SourceXtractor::PyFitsFile::PyFitsFile
PyFitsFile(const std::string &filename)
Definition:
PyFitsFile.cpp:24
SourceXtractor::PyFitsFile::getImageHdus
std::vector< int > getImageHdus() const
Definition:
PyFitsFile.cpp:28
std::map< std::string, std::string >
SourceXtractor
Definition:
Aperture.h:30
conf.filename
string filename
Definition:
conf.py:63
std::vector::push_back
T push_back(T... args)
std::vector< int >
Generated by
1.9.1