Commit 54522345d65c9b2b778962e147459c0a6c3cf75a
1 parent
cb1b53a6
add new exceptions
Showing
2 changed files
with
58 additions
and
0 deletions
include/GException.hpp
| ... | ... | @@ -257,6 +257,20 @@ public: |
| 257 | 257 | std::string message = ""); |
| 258 | 258 | }; |
| 259 | 259 | |
| 260 | + // Bad image dimension | |
| 261 | + class skymap_bad_ctype : public GExceptionHandler { | |
| 262 | + public: | |
| 263 | + skymap_bad_ctype(std::string origin, std::string ctype1, | |
| 264 | + std::string ctype2, std::string message = ""); | |
| 265 | + }; | |
| 266 | + | |
| 267 | + // Bad image dimension | |
| 268 | + class skymap_bad_image_dim : public GExceptionHandler { | |
| 269 | + public: | |
| 270 | + skymap_bad_image_dim(std::string origin, int naxis, | |
| 271 | + std::string message = ""); | |
| 272 | + }; | |
| 273 | + | |
| 260 | 274 | // General GWcs error |
| 261 | 275 | class wcs : public GExceptionHandler { |
| 262 | 276 | public: | ... | ... |
src/sky/GException_sky.cpp
| ... | ... | @@ -81,6 +81,50 @@ GException::skymap_bad_size::skymap_bad_size(std::string origin, |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | /***********************************************************************//** |
| 84 | + * @brief Incompatible ctype keywords | |
| 85 | + * | |
| 86 | + * @param[in] origin Method that throws the error. | |
| 87 | + * @param[in] ctype1 Encountered ctype1 keyword. | |
| 88 | + * @param[in] ctype1 Encountered ctype1 keyword. | |
| 89 | + * @param[in] message Error message. | |
| 90 | + ***************************************************************************/ | |
| 91 | +GException::skymap_bad_ctype::skymap_bad_ctype(std::string origin, | |
| 92 | + std::string ctype1, | |
| 93 | + std::string ctype2, | |
| 94 | + std::string message) | |
| 95 | +{ | |
| 96 | + // Set origin and message | |
| 97 | + m_origin = origin; | |
| 98 | + m_message = "CTYPE1 "+ctype1+") and CTYPE2 ("+ctype2+") header keywords" | |
| 99 | + " are not compatible. " + message; | |
| 100 | + | |
| 101 | + // Return | |
| 102 | + return; | |
| 103 | +} | |
| 104 | + | |
| 105 | + | |
| 106 | +/***********************************************************************//** | |
| 107 | + * @brief Bad image dimension | |
| 108 | + * | |
| 109 | + * @param[in] origin Method that throws the error. | |
| 110 | + * @param[in] naxis Encountered number of axes. | |
| 111 | + * @param[in] message Error message. | |
| 112 | + ***************************************************************************/ | |
| 113 | +GException::skymap_bad_image_dim::skymap_bad_image_dim(std::string origin, | |
| 114 | + int naxis, | |
| 115 | + std::string message) | |
| 116 | +{ | |
| 117 | + // Set origin and message | |
| 118 | + m_origin = origin; | |
| 119 | + m_message = "Invalid number of image dimensions (naxis="+str(naxis)+")." | |
| 120 | + " " + message; | |
| 121 | + | |
| 122 | + // Return | |
| 123 | + return; | |
| 124 | +} | |
| 125 | + | |
| 126 | + | |
| 127 | +/***********************************************************************//** | |
| 84 | 128 | * @brief General GWcs error |
| 85 | 129 | * |
| 86 | 130 | * @param[in] origin Method that throws the error. | ... | ... |