22 #ifndef ASTSHIM_DETAIL_UTILS_H 23 #define ASTSHIM_DETAIL_UTILS_H 31 #include "astshim/base.h" 36 static const int FITSLEN = 80;
39 inline void annulAstObject(AstObject *
object) {
40 if (
object !=
nullptr) {
45 template <
typename T1,
typename T2>
46 inline void assertEqual(T1 val1, std::string
const &descr1, T2 val2, std::string
const &descr2) {
48 std::ostringstream os;
49 os << descr1 <<
" = " << val1 <<
" != " << descr2 <<
" = " << val2;
50 throw std::invalid_argument(os.str());
57 inline void astBadToNan(std::vector<double> &p) {
59 if (val == AST__BAD) {
60 val = std::numeric_limits<double>::quiet_NaN();
77 inline std::string formatAxisAttr(std::string
const &name,
int axis) {
79 os << name <<
"(" << axis <<
")";
86 bool isSeries(AstCmpMap
const *
cmpMap);
93 std::string getClassName(AstObject
const *rawObj);
98 inline double safeDouble(
double val) {
100 return val != AST__BAD ? val : std::numeric_limits<double>::quiet_NaN();
106 inline std::string stringToUpper(std::string
const &str) {
108 upstr.reserve(str.size());
110 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