22 #ifndef ASTSHIM_DETAIL_UTILS_H
23 #define ASTSHIM_DETAIL_UTILS_H
27 #include "astshim/base.h"
32 static const int FITSLEN = 80;
35 inline void annulAstObject(AstObject *
object) {
36 if (
object !=
nullptr) {
41 template <
typename T1,
typename T2>
42 inline void assertEqual(T1 val1, std::string
const &descr1, T2 val2, std::string
const &descr2) {
44 std::ostringstream os;
45 os << descr1 <<
" = " << val1 <<
" != " << descr2 <<
" = " << val2;
46 throw std::invalid_argument(os.str());
53 inline void astBadToNan(std::vector<double> &p) {
55 if (val == AST__BAD) {
56 val = std::numeric_limits<double>::quiet_NaN();
73 inline std::string formatAxisAttr(std::string
const &name,
int axis) {
75 os << name <<
"(" << axis <<
")";
82 bool isSeries(AstCmpMap
const *cmpMap);
89 std::string getClassName(AstObject
const *rawObj);
94 inline double safeDouble(
double val) {
96 return val != AST__BAD ? val : std::numeric_limits<double>::quiet_NaN();
ndarray::Array< double, 2, 2 > Array2D
Definition: base.h:42
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Definition: base.cc:49