LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
22 #ifndef ASTSHIM_MAPPING_H
23 #define ASTSHIM_MAPPING_H
249 AstObject *rawSimpMap =
reinterpret_cast<AstObject *
>(astSimplify(
getRawPtr()));
251 return Object::fromAstObject<Mapping>(rawSimpMap,
true);
284 _tran(fromArr,
true, toArr);
318 _tran(fromArr,
false, toArr);
360 _tranGrid(lbnd, ubnd, tol, maxpix,
true,
to);
371 _tranGrid(lbnd, ubnd, tol, maxpix,
true,
to);
382 _tranGrid(lbnd, ubnd, tol, maxpix,
false,
to);
392 _tranGrid(lbnd, ubnd, tol, maxpix,
false,
to);
400 explicit Mapping(AstMapping *rawMap) :
Object(reinterpret_cast<AstObject *>(rawMap)) {
404 os <<
"this is a " <<
getClassName() <<
", which is not a Mapping";
411 return std::static_pointer_cast<Mapping>(copyImpl<Mapping, AstMapping>());
427 template <
typename Class>
443 void _tranGrid(
PointI const &lbnd,
PointI const &ubnd,
double tol,
int maxpix,
bool doForward,
Mapping & operator=(Mapping &&)=default
Mapping(Mapping &&)=default
bool getB(std::string const &attrib) const
Get the value of an attribute as a bool.
Array2D tranGridForward(PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, int nPts) const
Transform a grid of points in the inverse direction, returning the results as a new Array2D.
void tranGridInverse(PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, Array2D const &to) const
Transform a grid of points in the inverse direction.
std::shared_ptr< Mapping > simplified() const
Return a simplied version of the mapping (which may be a compound Mapping such as a CmpMap).
void tranGridForward(PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, Array2D const &to) const
Transform a grid of points in the forward direction.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
void setB(std::string const &attrib, bool value)
Set the value of an attribute as a bool.
virtual std::shared_ptr< Object > copyPolymorphic() const override
Return a deep copy of this object.
SeriesMap then(Mapping const &next) const
Return a series compound mapping this(first(input)) containing shallow copies of the original.
An abstract base class for objects which transform one set of coordinates to another.
std::shared_ptr< Class > decompose(int i, bool copy) const
Return a deep copy of one of the two component mappings.
void applyInverse(ConstArray2D const &from, Array2D const &to) const
Perform an inverse transformation on a 2-D array, putting the results into a pre-allocated 2-D array.
Abstract base class for all AST objects.
int getNOut() const
Get NOut: the number of output axes.
std::vector< double > applyForward(std::vector< double > const &from) const
Perform a forward transformation on a vector, returning the results as a new vector.
std::vector< double > applyInverse(std::vector< double > const &from) const
Perform an inverse transformation on a vector, returning the results as a new vector.
bool hasInverse() const
Is the inverse transform available?
ParallelMap under(Mapping const &next) const
Return a parallel compound mapping containing shallow copies of the original.
Array2D linearApprox(PointD const &lbnd, PointD const &ubnd, double tol) const
Compute a linear approximation to the forward transformation.
Mapping(Mapping const &)=default
Copy constructor: make a deep copy.
A series compound mapping where the first Mapping is used to transform the coordinates of each point ...
bool hasForward() const
Is the forward transform available?
double rate(PointD const &at, int ax1, int ax2) const
Evaluate the rate of change of the Mapping with respect to a specified input, at a specified position...
bool isInverted() const
Is this an inverted mapping?
std::string getClassName() const
Get Class: the name of the class (e.g.
int getI(std::string const &attrib) const
Get the value of an attribute as an int.
ndarray::Array< double, 2, 2 > Array2D
2D array of const double; typically used for lists of const points
Mapping(AstMapping *rawMap)
Construct a mapping from a pointer to a raw AST subclass of AstMapping.
Mapping & operator=(Mapping const &)=delete
Array2D tranGridInverse(PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, int nPts) const
Transform a grid of points in the inverse direction.
void applyForward(ConstArray2D const &from, Array2D const &to) const
Perform a forward transformation on 2-D array, putting the results into a pre-allocated 2-D array.
Array2D applyInverse(ConstArray2D const &from) const
Perform an inverse transformation on a 2-D array, returning the results as a new 2-D array.
std::shared_ptr< Mapping > copy() const
Return a deep copy of this object.
std::shared_ptr< Mapping > inverted() const
Get an inverse mapping.
void setReport(bool report)
Set Report: report transformed coordinates to stdout?
AST wrapper classes and functions.
int getNIn() const
Get NIn: the number of input axes.
bool getReport() const
Get Report: report transformed coordinates to stdout?
bool getIsLinear() const
Get IsLinear: is the Mapping linear?
ConstArray2D arrayFromVector(std::vector< double > const &vec, int nAxes)
Reshape a vector as a 2-dimensional array that shares the same memory.
A parallel compound mapping where the first Mapping is used to transform the lower numbered coordinat...
AstObject const * getRawPtr() const
Get the raw AST pointer.
bool getIsSimple() const
Get IsSimple: has the mapping been simplified?
Array2D applyForward(ConstArray2D const &from) const
Perform a forward transformation on a 2-D array, returning the results as a new array.
void assertEqual(T1 val1, std::string const &descr1, T2 val2, std::string const &descr2)
ndarray::Array< const double, 2, 2 > ConstArray2D
2D array of const double; typically used for lists of const points