Elements  5.10
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CCfitsExample.cpp
Go to the documentation of this file.
1 
21 #include <map> // for map
22 #include <string> // for string
23 #include <boost/program_options.hpp> // for program options from configuration file of command line arguments
24 
25 #include <CCfits/CCfits> // header file to test
26 
27 #include "ElementsKernel/ProgramHeaders.h" // for including all Program/related headers
28 #include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
30 
31 using std::string;
32 using std::map;
33 using boost::program_options::variable_value;
34 
35 namespace Elements {
36 namespace Examples {
37 
38 class CCfitsExample: public Program {
39 
40 public:
41 
43 
44  auto log = Logging::getLogger("CCfitsExample");
45 
46  string test_upper_string {"THATSTRING"};
47  log.info() << "This is the test upper string: " << test_upper_string;
48 
49 
50  string test_lower_string = CCfits::FITSUtil::lowerCase(test_upper_string);
51  log.info() << "This is the test lower string: " << test_lower_string;
52 
53  log.info() << "done with test program! ";
54 
55  auto fits_file_path = getAuxiliaryPath("ElementsExamples/phz_cat.fits");
56  log.info() << "Opening the file " << fits_file_path.string();
57  CCfits::FITS fits_file(fits_file_path.string());
58 
59 
60  CCfits::ExtHDU& extension = fits_file.extension(1);
61 
62 
63  log.info() << "Extension comments: " << extension.getComments();
64 
65 
66  return ExitCode::OK;
67 
68  }
69 
70 };
71 
72 } // namespace Examples
73 } // namespace Elements
74 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
Macro to silence unused variables warnings from the compiler.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
provide functions to retrieve auxiliary files
Everything is OK.
Abstract class for all Elements programs.
Definition: Program.h:51
STL class.
STL class.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:117
boost::filesystem::path getAuxiliaryPath(const T &file_name, bool raise_exception)
Definition: Auxiliary.icpp:33
#define ELEMENTS_UNUSED
Definition: Unused.h:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63