SourceXtractorPlusPlus 0.18
SourceXtractor++, the next generation SExtractor
PyFitsFile.cpp
Go to the documentation of this file.
1
18#include "SEUtils/VariantCast.h"
20#include <boost/algorithm/string.hpp>
21
22namespace SourceXtractor {
23
25 m_file = std::make_shared<FitsFile>(filename, false);
26}
27
30
31 for(auto num : m_file->getImageHdus()) {
32 v.push_back(num-1);
33 }
34
35 return v;
36}
37
39 const auto& headers = m_file->getHDUHeaders(hdu+1);
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}
std::shared_ptr< FitsFile > m_file
Definition: PyFitsFile.h:46
std::map< std::string, std::string > getHeaders(int hdu) const
Definition: PyFitsFile.cpp:38
PyFitsFile(const std::string &filename)
Definition: PyFitsFile.cpp:24
std::vector< int > getImageHdus() const
Definition: PyFitsFile.cpp:28
string filename
Definition: conf.py:65
T push_back(T... args)