Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
ElementsExamples/src/program/CCfits.cpp

This is an example of how to use the Auxiliary::getPath function.

#include <map> // for map
#include <string> // for string
#include <CCfits/CCfits> // header file to test
#include "ElementsKernel/ProgramHeaders.h" // for including all Program/related headers
#include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
using std::map;
namespace Elements {
namespace Examples {
class CCfits : public Program {
public:
ExitCode mainMethod(ELEMENTS_UNUSED map<string, VariableValue>& args) override {
auto log = Logging::getLogger("CCfits");
string test_upper_string{"THATSTRING"};
log.info() << "This is the test upper string: " << test_upper_string;
string test_lower_string = ::CCfits::FITSUtil::lowerCase(test_upper_string);
log.info() << "This is the test lower string: " << test_lower_string;
log.info() << "done with test program! ";
auto fits_file_path = Auxiliary::getPath("ElementsExamples/phz_cat.fits");
log.info() << "Opening the file " << fits_file_path.string();
::CCfits::FITS fits_file(fits_file_path.string());
::CCfits::ExtHDU& extension = fits_file.extension(1);
log.info() << "Extension comments: " << extension.getComments();
return ExitCode::OK;
}
};
} // namespace Examples
} // namespace Elements
provide functions to retrieve auxiliary files
Macro to silence unused variables warnings from the compiler.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition: CCfits.cpp:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63
Elements::ExitCode ExitCode
Definition: Program.h:67
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
#define ELEMENTS_UNUSED
Definition: Unused.h:39
@ OK
Everything is OK.