LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
42 auto rawCopy =
reinterpret_cast<AstMapping *
>(astCopy(
getRawPtr()));
44 assertOK(
reinterpret_cast<AstObject *
>(rawCopy));
46 return Object::fromAstObject<Mapping>(
reinterpret_cast<AstObject *
>(rawCopy),
false);
54 Array2D fit = ndarray::allocate(ndarray::makeVector(1 + nIn, nOut));
55 int isOK = astLinearApprox(
getRawPtr(), lbnd.
data(), ubnd.
data(), tol, fit.getData());
63 template <
typename Class>
65 if ((i < 0) || (i > 1)) {
67 os <<
"i =" << i <<
"; must be 0 or 1";
75 int series, invert1, invert2;
76 astDecompose(
getRawPtr(), &rawMap1, &rawMap2, &series, &invert1, &invert2);
81 astAnnul(
reinterpret_cast<AstObject *
>(rawMap1));
88 AstMapping *retRawMap;
91 retRawMap =
reinterpret_cast<AstMapping *
>(astCopy(
reinterpret_cast<AstObject *
>(rawMap1)));
94 retRawMap =
reinterpret_cast<AstMapping *
>(astCopy(
reinterpret_cast<AstObject *
>(rawMap2)));
97 astAnnul(
reinterpret_cast<AstObject *
>(rawMap1));
98 astAnnul(
reinterpret_cast<AstObject *
>(rawMap2));
104 if (
invert != astGetI(retRawMap,
"Invert")) {
105 astInvert(retRawMap);
109 return Object::fromAstObject<Class>(
reinterpret_cast<AstObject *
>(retRawMap),
copy);
119 int const nPts =
from.getSize<1>();
122 astTranN(
getRawPtr(), nPts, nFromAxes, nPts,
from.getData(),
static_cast<int>(doForward), nToAxes, nPts,
129 void Mapping::_tranGrid(
PointI const &lbnd,
PointI const &ubnd,
double tol,
int maxpix,
bool doForward,
136 int const nPts =
to.getSize<0>();
137 astTranGrid(
getRawPtr(), nFromAxes, lbnd.data(), ubnd.data(), tol, maxpix,
static_cast<int>(doForward),
138 nToAxes, nPts,
to.getData());
std::vector< int > PointI
Vector of ints; typically used for the bounds of Mapping.tranGridForward and inverse.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
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.
int getNOut() const
Get NOut: the number of output axes.
void astBadToNan(std::vector< double > &p)
Replace AST__BAD with a quiet NaN in a vector.
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.
A series compound mapping where the first Mapping is used to transform the coordinates of each point ...
std::string getClassName() const
Get Class: the name of the class (e.g.
ndarray::Array< double, 2, 2 > Array2D
2D array of const double; typically used for lists of const points
std::shared_ptr< Mapping > copy() const
Return a deep copy of this object.
std::shared_ptr< Mapping > inverted() const
Get an inverse mapping.
AST wrapper classes and functions.
int getNIn() const
Get NIn: the number of input axes.
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.
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
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.