22 #ifndef ASTSHIM_DETAIL_UTILS_H 23 #define ASTSHIM_DETAIL_UTILS_H 36 static const int FITSLEN = 80;
40 if (
object !=
nullptr) {
45 template <
typename T1,
typename T2>
49 os << descr1 <<
" = " << val1 <<
" != " << descr2 <<
" = " << val2;
59 if (
val == AST__BAD) {
79 os << name <<
"(" << axis <<
")";
void annulAstObject(AstObject *object)
A wrapper around astAnnul; intended as a custom deleter for std::unique_ptr.
table::Key< std::string > name
ndarray::Array< double, 2, 2 > Array2D
2D array of const double; typically used for lists of const points
AST wrapper classes and functions.
std::string stringToUpper(std::string const &str)
Return a copy of a string in which all characters are uppercase.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
void astBadToNan(std::vector< double > &p)
Replace AST__BAD with a quiet NaN in a vector.
bool isSeries(AstCmpMap const *cmpMap)
Return true if the compound map is in series.
std::string getClassName(AstObject const *rawObj)
Get the AST class name, changing CmpMap to SeriesMap or ParallelMap as appropriate.
std::string formatAxisAttr(std::string const &name, int axis)
Format an axis-specific attribute by appending the axis index.
double safeDouble(double val)
Return a double value after checking status and replacing AST__BAD with nan
void assertEqual(T1 val1, std::string const &descr1, T2 val2, std::string const &descr2)