lsst.astshim gee0fe1808a+052faf71bd
Functions
ast::detail Namespace Reference

Functions

template<class AstMapT , class MapT >
AstMapT * polyTranImpl (MapT const &mapping, bool forward, double acc, double maxacc, int maxorder, std::vector< double > const &lbnd, std::vector< double > const &ubnd)
 
FrameDict makeFrameDict (FrameSet const &frameSet)
 
void annulAstObject (AstObject *object)
 A wrapper around astAnnul; intended as a custom deleter for std::unique_ptr. More...
 
template<typename T1 , typename T2 >
void assertEqual (T1 val1, std::string const &descr1, T2 val2, std::string const &descr2)
 
void astBadToNan (std::vector< double > &p)
 
void astBadToNan (ast::Array2D const &arr)
 
std::string formatAxisAttr (std::string const &name, int axis)
 
bool isSeries (AstCmpMap const *cmpMap)
 
std::string getClassName (AstObject const *rawObj)
 
double safeDouble (double val)
 
std::string stringToUpper (std::string const &str)
 
const char * source ()
 
void sink (const char *cstr)
 
template AstChebyMap * polyTranImpl< AstChebyMap > (ChebyMap const &, bool, double, double, int, std::vector< double > const &, std::vector< double > const &)
 
template AstPolyMap * polyTranImpl< AstPolyMap > (PolyMap const &, bool, double, double, int, std::vector< double > const &, std::vector< double > const &)
 

Function Documentation

◆ annulAstObject()

void ast::detail::annulAstObject ( AstObject *  object)
inline

A wrapper around astAnnul; intended as a custom deleter for std::unique_ptr.

◆ assertEqual()

template<typename T1 , typename T2 >
void ast::detail::assertEqual ( T1  val1,
std::string const &  descr1,
T2  val2,
std::string const &  descr2 
)
inline

◆ astBadToNan() [1/2]

void ast::detail::astBadToNan ( ast::Array2D const &  arr)

Replace AST__BAD with a quiet NaN in a 2-D array

◆ astBadToNan() [2/2]

void ast::detail::astBadToNan ( std::vector< double > &  p)
inline

Replace AST__BAD with a quiet NaN in a vector

◆ formatAxisAttr()

std::string ast::detail::formatAxisAttr ( std::string const &  name,
int  axis 
)
inline

Format an axis-specific attribute by appending the axis index

Parameters
[in]nameAttribute name
[in]axisAxis index, starting at 1
Returns
"<name>(<axis>)"

◆ getClassName()

std::string ast::detail::getClassName ( AstObject const *  rawObj)

Get the AST class name, changing CmpMap to SeriesMap or ParallelMap as appropriate.

Parameters
[in]rawObjRaw AST object pointer

◆ isSeries()

bool ast::detail::isSeries ( AstCmpMap const *  cmpMap)

Return true if the compound map is in series

◆ makeFrameDict()

FrameDict ast::detail::makeFrameDict ( FrameSet const &  frameSet)

Make a FrameDict from a copy of a FrameSet

This exists purely to test FrameDict(FrameSet const &) from Python, as the standard pybind11 wrapper isn't sufficient to exercise a bug that was found.

◆ polyTranImpl()

template<class AstMapT , class MapT >
AstMapT * ast::detail::polyTranImpl ( MapT const &  mapping,
bool  forward,
double  acc,
double  maxacc,
int  maxorder,
std::vector< double > const &  lbnd,
std::vector< double > const &  ubnd 
)

Call astPolyTran to set (or replace) one direction of a polynomial transform with a fit based on the other direction.

Template Parameters
AstMapTAST mapping class: one of AstChebyMap or AstPolyMap
MapTCorresponding astshim class: one of ast::ChebyMap or ast::PolyMap; this template parameter is second because it can always be deduced.
Parameters
[in]mapping
[in]forwardIf true the forward transformation is replaced. Otherwise the inverse transformation is replaced.
[in]accThe target accuracy, expressed as a geodesic distance within the ChebyMap's input space (if forward is false) or output space (if forward is true).
[in]maxaccThe maximum allowed accuracy for an acceptable polynomial, expressed as a geodesic distance within the ChebyMap's input space (if forward is false) or output space (if forward is true).
[in]maxorderThe maximum allowed polynomial order. This is one more than the maximum power of either input axis. So for instance, a value of 3 refers to a quadratic polynomial. Note, cross terms with total powers greater than or equal to maxorder are not inlcuded in the fit. So the maximum number of terms in each of the fitted polynomials is maxorder*(maxorder + 1)/2.
[in]lbndA vector holding the lower bounds of a rectangular region within the ChebyMap's input space (if forward is false) or output space (if forward is true). The new polynomial will be evaluated over this rectangle. The length should equal getNIn() or getNOut(), depending on forward.
[in]ubndA vector holding the upper bounds of a rectangular region within the ChebyMap's input space (if forward is false) or output space (if forward is true). The new polynomial will be evaluated over this rectangle. The length should equal getNIn() or getNOut(), depending on forward.
Exceptions
std::invalid_argumentif the size of lbnd or ubnd does not match getNIn() (if forward false) or getNOut() (if forward true).

◆ polyTranImpl< AstChebyMap >()

template AstChebyMap * ast::detail::polyTranImpl< AstChebyMap > ( ChebyMap const &  ,
bool  ,
double  ,
double  ,
int  ,
std::vector< double > const &  ,
std::vector< double > const &   
)

◆ polyTranImpl< AstPolyMap >()

template AstPolyMap * ast::detail::polyTranImpl< AstPolyMap > ( PolyMap const &  ,
bool  ,
double  ,
double  ,
int  ,
std::vector< double > const &  ,
std::vector< double > const &   
)

◆ safeDouble()

double ast::detail::safeDouble ( double  val)
inline

Return a double value after checking status and replacing AST__BAD with nan

◆ sink()

void ast::detail::sink ( const char *  cstr)
inline

Sink function that allows astChannel to sink to a Stream

This function retrieves a pointer to a Stream ssptr using astChannelData, then calls ssptr->sink(cstr).

◆ source()

const char * ast::detail::source ( )
inline

Source function that allows astChannel to source from a Stream

This function retrieves a pointer to a Stream ssptr using astChannelData, then returns the result of calling ssptr->source()

◆ stringToUpper()

std::string ast::detail::stringToUpper ( std::string const &  str)
inline

Return a copy of a string in which all characters are uppercase