Elements  6.0.1
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 
24 #include <CCfits/CCfits> // header file to test
25 
27 #include "ElementsKernel/ProgramHeaders.h" // for including all Program/related headers
28 #include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
29 
30 using std::map;
31 using std::string;
32 
33 namespace Elements {
34 namespace Examples {
35 
36 class CCfitsExample : public Program {
37 
38 public:
40 
41  auto log = Logging::getLogger("CCfitsExample");
42 
43  string test_upper_string{"THATSTRING"};
44  log.info() << "This is the test upper string: " << test_upper_string;
45 
46  string test_lower_string = CCfits::FITSUtil::lowerCase(test_upper_string);
47  log.info() << "This is the test lower string: " << test_lower_string;
48 
49  log.info() << "done with test program! ";
50 
51  auto fits_file_path = Auxiliary::getPath("ElementsExamples/phz_cat.fits");
52  log.info() << "Opening the file " << fits_file_path.string();
53  CCfits::FITS fits_file(fits_file_path.string());
54 
55  CCfits::ExtHDU& extension = fits_file.extension(1);
56 
57  log.info() << "Extension comments: " << extension.getComments();
58 
59  return ExitCode::OK;
60  }
61 };
62 
63 } // namespace Examples
64 } // namespace Elements
65 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Macro to silence unused variables warnings from the compiler.
provide functions to retrieve auxiliary files
Everything is OK.
Abstract class for all Elements programs.
Definition: Program.h:52
STL class.
STL class.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
ELEMENTS_API Path::Item getPath(const T &file_name, bool raise_exception=true)
alias for the getAuxiliaryPath function
#define ELEMENTS_UNUSED
Definition: Unused.h:39
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63