Elements  6.2
A C++ base framework for the Euclid Software.
CCfits.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 CCfits : public Program {
37 
38 public:
40 
41  auto log = Logging::getLogger("CCfits");
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 
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::CCfits::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: CCfits.cpp:39
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Elements::Examples::Program
Simple example of an Elements program.
Definition: Program.cpp:79
Elements::Examples::CCfits
Definition: CCfits.cpp:36
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition: BackTrace.cpp:36
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
Auxiliary.h
provide functions to retrieve auxiliary files
Unused.h
Macro to silence unused variables warnings from the compiler.
Elements::Kernel::Auxiliary::getPath
ELEMENTS_API Path::Item getPath(const T &file_name, bool raise_exception=true)
alias for the getAuxiliaryPath function
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition: Unused.h:39
Elements
Definition: callBackExample.h:35