22 #ifndef ASTSHIM_PCDMAP_H 23 #define ASTSHIM_PCDMAP_H 30 #include "astshim/base.h" 31 #include "astshim/detail/utils.h" 32 #include "astshim/Mapping.h" 87 PcdMap(
double disco, std::vector<double>
const &pcdcen, std::string
const &options =
"")
88 :
Mapping(reinterpret_cast<AstMapping *>(_makeRawPcdMap(disco, pcdcen, options))) {}
104 double getPcdCen(
int axis)
const {
return getD(detail::formatAxisAttr(
"PcdCen", axis)); }
108 std::vector<double> ctr;
109 for (
auto axis = 1; axis < 3; ++axis) {
117 return copyImpl<PcdMap, AstPcdMap>();
121 explicit PcdMap(AstPcdMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
123 std::ostringstream os;
124 os <<
"this is a " <<
getClassName() <<
", which is not a PcdMap";
125 throw std::invalid_argument(os.str());
130 AstPcdMap *_makeRawPcdMap(
double disco, std::vector<double>
const &pcdcen,
131 std::string
const &options =
"") {
132 if (pcdcen.size() != 2) {
133 std::ostringstream os;
134 os <<
"pcdcen.size() = " << pcdcen.size() <<
"; must be 2";
135 throw std::invalid_argument(os.str());
137 return astPcdMap(disco, pcdcen.data(),
"%s", options.c_str());
std::shared_ptr< PcdMap > copy() const
Return a deep copy of this object.
Definition: PcdMap.h:98
AstObject const * getRawPtr() const
Definition: Object.h:289
std::vector< double > getPcdCen() const
Get PcdMap_PcdCen PcdCen for both axes: centre coordinates of pincushion/barrel distortion.
Definition: PcdMap.h:107
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
std::string getClassName() const
Definition: Object.h:136
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: PcdMap.h:116
PcdMap(double disco, std::vector< double > const &pcdcen, std::string const &options="")
Definition: PcdMap.h:87
double getPcdCen(int axis) const
Get PcdMap_PcdCen PcdCen(axis) for one axis: centre coordinates of pincushion/barrel distortion...
Definition: PcdMap.h:104
double getD(std::string const &attrib) const
Definition: Object.h:376
double getDisco() const
Get Disco: pincushion/barrel distortion coefficient.
Definition: PcdMap.h:101
PcdMap(AstPcdMap *rawptr)
Construct a PcdMap from a raw AST pointer.
Definition: PcdMap.h:121