Class Point2Endpoint

Inheritance Relationships

Base Type

Class Documentation

class Point2Endpoint : public lsst::afw::geom::BaseVectorEndpoint<lsst::geom::Point2D>

An endpoint for lsst::geom::Point2D

Public Functions

Point2Endpoint(Point2Endpoint const&)
Point2Endpoint(Point2Endpoint&&)
Point2Endpoint &operator=(Point2Endpoint const&)
Point2Endpoint &operator=(Point2Endpoint&&)
Point2Endpoint()

Construct a Point2Endpoint

Point2Endpoint(int nAxes)

Construct a Point2Endpoint with nAxes specified; nAxes must equal template parameter N

This constructor is primarily used by Transform; other users are encouraged to use the default constructor.

Parameters
  • [in] nAxes: The number of axes in a point; must equal template parameter N

Exceptions
  • lsst.pex.exceptions.InvalidParameterError: if nAxes != N

~Point2Endpoint()
std::vector<double> dataFromPoint(Point const &point) const

Get raw data from a single point

Return

the values in the point as a vector of size NAxess

Parameters
  • [in] point: data for a single point

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if the point has the wrong number of axes

ndarray::Array<double, 2, 2> dataFromArray(Array const &arr) const

Get raw data from an array of points

Return

the data as a 2-D ndarray array [nAxes, nPoints] in C order, so the in-memory view is, for example, x0, x1, x2, …, y0, y1, y2, …

Parameters
  • [in] arr: Array of points

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if the array has the wrong nAxes dimension

Point pointFromData(std::vector<double> const &data) const

Get a single point from raw data

Return

the corresponding point

Parameters
  • [in] data: Data as a vector of length NAxes

Array arrayFromData(ndarray::Array<double, 2, 2> const &data) const

Get an array of points from raw data

Return

an array of points

Parameters
  • [in] data: Raw data for an array of points, as a 2-D ndarray array [nPoints, nAxes] in C order, so the in-memory view is, for example, x0, y0, x1, y1, x2, y2, …

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if the array has the wrong nAxes dimension

void normalizeFrame(std::shared_ptr<ast::Frame> framePtr) const

Check that framePtr points to a Frame, not a subclass

Subclasses are forbidden because lsst::geom::Point2D is assumed to be cartesian and subclasses of Frame are not (e.g. SkyFrame, SpecFrame and TimeFrame). Note that SpecFrame and TimeFrame are 1-dimensional so they cannot be used in any case. A CmpFrame could be cartesian, but we play it safe and reject these (however, a cartesian CmpFrame ought to simplify to a Frame).

Public Static Functions

static std::string getClassPrefix()

Get the class name prefix, e.g. “Point2” for “Point2Endpoint”.