Elements  5.10
A C++ base framework for the Euclid Software.
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 
Elements::ExitCode::OK
@ OK
Everything is OK.
Elements::Examples::CCfitsExample::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
Definition: CCfitsExample.cpp:42
std::string
STL class.
Elements::getAuxiliaryPath
ELEMENTS_API boost::filesystem::path getAuxiliaryPath(const T &file_name, bool raise_exception=true)
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition: BackTraceExample.cpp:38
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
Elements::Examples::CCfitsExample
Definition: CCfitsExample.cpp:38
Elements::Program
Abstract class for all Elements programs.
Definition: Program.h:51
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:117
Auxiliary.h
provide functions to retrieve auxiliary files
Unused.h
Macro to silence unused variables warnings from the compiler.
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition: Unused.h:39
Elements
Definition: ClassExample.h:38