LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
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