22 #ifndef ASTSHIM_DETAIL_UTILS_H 23 #define ASTSHIM_DETAIL_UTILS_H 32 #include "astshim/base.h" 37 static const int FITSLEN = 80;
40 inline void annulAstObject(AstObject *
object) {
41 if (
object !=
nullptr) {
46 template <
typename T1,
typename T2>
47 inline void assertEqual(T1 val1, std::string
const &descr1, T2 val2, std::string
const &descr2) {
49 std::ostringstream os;
50 os << descr1 <<
" = " << val1 <<
" != " << descr2 <<
" = " << val2;
51 throw std::invalid_argument(os.str());
58 inline void astBadToNan(std::vector<double> &p) {
60 if (val == AST__BAD) {
61 val = std::numeric_limits<double>::quiet_NaN();
78 inline std::string formatAxisAttr(std::string
const &name,
int axis) {
80 os << name <<
"(" << axis <<
")";
87 bool isSeries(AstCmpMap
const *
cmpMap);
94 std::string getClassName(AstObject
const *rawObj);
99 inline double safeDouble(
double val) {
101 return val != AST__BAD ? val : std::numeric_limits<double>::quiet_NaN();
107 inline std::string stringToUpper(std::string
const &str) {
109 upstr.reserve(str.size());
111 upstr += std::toupper(c);
ndarray::Array< double, 2, 2 > Array2D
Definition: base.h:42
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Definition: base.cc:49