Elements  6.2
A C++ base framework for the Euclid Software.
GnuAstro.cpp
Go to the documentation of this file.
1 
21 #include <map> // for map
22 #include <string> // for string
23 
24 #include <gnuastro/cosmology.h>
25 #include <gnuastro/fits.h> // header file to test
26 
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 GnuAstro : public Program {
37 
38 public:
40 
41  auto log = Logging::getLogger("GnuAstroExample");
42 
43  string test_upper_string{"THATSTRING"};
44  log.info() << "This is the test upper string: " << test_upper_string;
45 
46  double z{2.5};
47  double H0{67.66};
48 
49  auto age = gal_cosmology_age(z, H0, 0.0, 0.0, 0.0);
50 
51  log.info() << "Age of the Universe @ z = " << z << " : " << age << " GA";
52 
53  return ExitCode::OK;
54  }
55 };
56 
57 } // namespace Examples
58 } // namespace Elements
59 
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::GnuAstro
Definition: GnuAstro.cpp:36
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Elements::Examples::Program
Simple example of an Elements program.
Definition: Program.cpp:79
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
Elements::Examples::GnuAstro::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: GnuAstro.cpp:39
Unused.h
Macro to silence unused variables warnings from the compiler.
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition: Unused.h:39
Elements
Definition: callBackExample.h:35