SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
24PyFitsFile::PyFitsFile(const std::string& filename) : m_filename(filename) {
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 return m_file->getDimensions(hdu+1);
40}
41
42
44 const auto& headers = m_file->getHDUHeaders(hdu+1);
46
47 for (auto& i : headers) {
48 auto key = i.first;
49 auto value = VariantCast<std::string>(i.second.m_value);
50 boost::trim(key);
51 boost::trim(value);
52 headers_str[key] = value;
53 }
54
55 return headers_str;
56}
57
58}
std::shared_ptr< FitsFile > m_file
Definition PyFitsFile.h:47
std::map< std::string, std::string > getHeaders(int hdu) const
std::vector< int > getDimensions(int hdu) const
PyFitsFile(const std::string &filename)
std::vector< int > getImageHdus() const