diff --git a/include/GException.hpp b/include/GException.hpp index 87e3b3e..8e13881 100644 --- a/include/GException.hpp +++ b/include/GException.hpp @@ -257,6 +257,20 @@ public: std::string message = ""); }; + // Bad image dimension + class skymap_bad_ctype : public GExceptionHandler { + public: + skymap_bad_ctype(std::string origin, std::string ctype1, + std::string ctype2, std::string message = ""); + }; + + // Bad image dimension + class skymap_bad_image_dim : public GExceptionHandler { + public: + skymap_bad_image_dim(std::string origin, int naxis, + std::string message = ""); + }; + // General GWcs error class wcs : public GExceptionHandler { public: diff --git a/src/sky/GException_sky.cpp b/src/sky/GException_sky.cpp index 0490721..e7d1198 100644 --- a/src/sky/GException_sky.cpp +++ b/src/sky/GException_sky.cpp @@ -81,6 +81,50 @@ GException::skymap_bad_size::skymap_bad_size(std::string origin, /***********************************************************************//** + * @brief Incompatible ctype keywords + * + * @param[in] origin Method that throws the error. + * @param[in] ctype1 Encountered ctype1 keyword. + * @param[in] ctype1 Encountered ctype1 keyword. + * @param[in] message Error message. + ***************************************************************************/ +GException::skymap_bad_ctype::skymap_bad_ctype(std::string origin, + std::string ctype1, + std::string ctype2, + std::string message) +{ + // Set origin and message + m_origin = origin; + m_message = "CTYPE1 "+ctype1+") and CTYPE2 ("+ctype2+") header keywords" + " are not compatible. " + message; + + // Return + return; +} + + +/***********************************************************************//** + * @brief Bad image dimension + * + * @param[in] origin Method that throws the error. + * @param[in] naxis Encountered number of axes. + * @param[in] message Error message. + ***************************************************************************/ +GException::skymap_bad_image_dim::skymap_bad_image_dim(std::string origin, + int naxis, + std::string message) +{ + // Set origin and message + m_origin = origin; + m_message = "Invalid number of image dimensions (naxis="+str(naxis)+")." + " " + message; + + // Return + return; +} + + +/***********************************************************************//** * @brief General GWcs error * * @param[in] origin Method that throws the error.