lsst.astshim
14.0-14-g99fab3d
|
#include <WcsMap.h>
Public Member Functions | |
WcsMap (int ncoord, WcsType type, int lonax, int latax, std::string const &options="") | |
WcsMap (WcsMap const &)=default | |
Copy constructor: make a deep copy. | |
WcsMap (WcsMap &&)=default | |
WcsMap & | operator= (WcsMap const &)=delete |
WcsMap & | operator= (WcsMap &&)=default |
std::shared_ptr< WcsMap > | copy () const |
Return a deep copy of this object. | |
double | getNatLat () const |
get NatLat: native latitude of the reference point of a FITS-WCS projection. | |
double | getNatLon () const |
get NatLon: native longitude of the reference point of a FITS-WCS projection. | |
double | getPVi_m (int i, int m) const |
int | getPVMax (int axis) const |
Get PVMax(axis) for one axis: maximum number of FITS-WCS projection parameters. | |
std::pair< int, int > | getWcsAxis () const |
WcsType | getWcsType () const |
Get WcsType: FITS-WCS projection type. | |
![]() | |
Mapping (Mapping const &)=default | |
Copy constructor: make a deep copy. | |
Mapping (Mapping &&)=default | |
Mapping & | operator= (Mapping const &)=delete |
Mapping & | operator= (Mapping &&)=default |
std::shared_ptr< Mapping > | copy () const |
Return a deep copy of this object. | |
int | getNIn () const |
int | getNOut () const |
bool | getIsSimple () const |
bool | isInverted () const |
bool | getIsLinear () const |
bool | getReport () const |
bool | hasForward () const |
bool | hasInverse () const |
std::shared_ptr< Mapping > | getInverse () const |
Array2D | linearApprox (PointD const &lbnd, PointD const &ubnd, double tol) const |
SeriesMap | then (Mapping const &next) const |
ParallelMap | under (Mapping const &next) const |
double | rate (PointD const &at, int ax1, int ax2) const |
void | setReport (bool report) |
std::shared_ptr< Mapping > | simplify () const |
void | applyForward (ConstArray2D const &from, Array2D const &to) const |
Array2D | applyForward (ConstArray2D const &from) const |
std::vector< double > | applyForward (std::vector< double > const &from) const |
void | applyInverse (ConstArray2D const &from, Array2D const &to) const |
Array2D | applyInverse (ConstArray2D const &from) const |
std::vector< double > | applyInverse (std::vector< double > const &from) const |
void | tranGridForward (PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, Array2D const &to) const |
Array2D | tranGridForward (PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, int nPts) const |
void | tranGridInverse (PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, Array2D const &to) const |
Array2D | tranGridInverse (PointI const &lbnd, PointI const &ubnd, double tol, int maxpix, int nPts) const |
![]() | |
Object (Object const &object) | |
Copy constructor: make a deep copy. | |
Object (Object &&)=default | |
Object & | operator= (Object const &)=delete |
Object & | operator= (Object &&)=default |
bool | operator== (Object const &rhs) const |
bool | operator!= (Object const &rhs) const |
std::shared_ptr< Object > | copy () const |
Return a deep copy of this object. | |
void | clear (std::string const &attrib) |
bool | hasAttribute (std::string const &attrib) const |
std::string | getClassName () const |
std::string | getID () const |
Get ID: object identification string that is not copied. | |
std::string | getIdent () const |
Get Ident: object identification string that is copied. | |
int | getNObject () const |
int | getObjSize () const |
Get ObjSize: the in-memory size of the AST object in bytes. | |
int | getRefCount () const |
bool | getUseDefs () const |
Get UseDefs: allow use of default values for Object attributes? | |
void | lock (bool wait) |
bool | same (Object const &other) const |
void | setID (std::string const &id) |
Set ID: object identification string that is not copied. | |
void | setIdent (std::string const &ident) |
Set Ident: object identification string that is copied. | |
void | setUseDefs (bool usedefs) |
Set UseDefs: allow use of default values for Object attributes? | |
void | show (std::ostream &os, bool showComments=true) const |
std::string | show (bool showComments=true) const |
bool | test (std::string const &attrib) const |
void | unlock (bool report=false) |
AstObject const * | getRawPtr () const |
AstObject * | getRawPtr () |
Protected Member Functions | |
virtual std::shared_ptr< Object > | copyPolymorphic () const override |
WcsMap (AstWcsMap *rawptr) | |
Construct a WcsMap from a raw AST pointer. | |
![]() | |
Mapping (AstMapping *rawMap) | |
template<typename Class > | |
std::shared_ptr< Class > | decompose (int i, bool copy) const |
![]() | |
Object (AstObject *object) | |
template<typename T , typename AstT > | |
std::shared_ptr< T > | copyImpl () const |
bool | getB (std::string const &attrib) const |
std::string const | getC (std::string const &attrib) const |
double | getD (std::string const &attrib) const |
float | getF (std::string const &attrib) const |
int | getI (std::string const &attrib) const |
long int | getL (std::string const &attrib) const |
void | set (std::string const &setting) |
void | setB (std::string const &attrib, bool value) |
void | setC (std::string const &attrib, std::string const &value) |
void | setD (std::string const &attrib, double value) |
void | setF (std::string const &attrib, float value) |
void | setI (std::string const &attrib, int value) |
void | setL (std::string const &attrib, long int value) |
Friends | |
class | Object |
Additional Inherited Members | |
![]() | |
using | ObjectPtr = std::unique_ptr< AstObject, Deleter > |
unique pointer holding an AST raw pointer | |
![]() | |
static std::shared_ptr< Object > | fromString (std::string const &str) |
template<typename Class > | |
static std::shared_ptr< Class > | fromAstObject (AstObject *rawObj, bool copy) |
![]() | |
template<typename ShimT , typename AstT > | |
static std::shared_ptr< ShimT > | makeShim (AstObject *p) |
Map from a spherical system to a cartesian system using standard FITS sky coordinate projections.
WcsMap is used to represent sky coordinate projections as described in the FITS world coordinate system (FITS-WCS) paper II "Representations of Celestial Coordinates in FITS" by M. Calabretta and E.W. Griesen. This paper defines a set of functions, or sky projections, which transform longitude-latitude pairs representing spherical celestial coordinates into corresponding pairs of Cartesian coordinates (and vice versa).
A WcsMap is a specialised form of Mapping which implements these sky projections and applies them to a specified pair of coordinates. All the projections in the FITS-WCS paper are supported, plus the now deprecated "TAN with polynomial correction terms" projection which is refered to here by the code "TPN". Using the FITS-WCS terminology, the transformation is between "native spherical" and "projection plane" coordinates (also called "intermediate world coordinates". These coordinates may, optionally, be embedded in a space with more than two dimensions, the remaining coordinates being copied unchanged. Note, however, that for consistency with other AST facilities, a WcsMap handles coordinates that represent angles in radians (rather than the degrees used by FITS-WCS).
The type of FITS-WCS projection to be used and the coordinates (axes) to which it applies are specified when a WcsMap is first created. The projection type may subsequently be determined using the WcsType attribute and the coordinates on which it acts may be determined using the WcsAxis(lonlat) attribute.
Each WcsMap also allows up to 100 "projection parameters" to be associated with each axis. These specify the precise form of the projection, and are accessed using PVi_m attribute, where "i" is the integer axis index (starting at 1), and "m" is an integer "parameter index" in the range 0 to 99. The number of projection parameters required by each projection, and their meanings, are dependent upon the projection type (most projections either do not use any projection parameters, or use parameters 1 and 2 associated with the latitude axis). Before creating a WcsMap you should consult the FITS-WCS paper for details of which projection parameters are required, and which have defaults. When creating the WcsMap, you must explicitly set values for all those required projection parameters which do not have defaults defined in this paper.
nan
.
|
inlineexplicit |
Create a WcsMap
[in] | ncoord | The number of coordinate values for each point to be transformed (i.e. the number of dimensions of the space in which the points will reside). This must be at least 2. The same number is applicable to both input and output points. |
[in] | type | The type of FITS-WCS projection to apply, as a WcsType enum such as WcsType::TAN (for a tangent plane projection). The enum constant name give the projection type code (in upper case) as used in the FITS-WCS "CTYPEi" keyword. You should consult the FITS-WCS paper for a list of the available projections. The additional code of WcsType::TPN can be supplied which represents a TAN projection with polynomial correction terms as defined in an early draft of the FITS-WCS paper. |
[in] | lonax | Index of the longitude axis. This should lie in the range 1 to ncoord . |
[in] | latax | Index of the latitude axis. This should lie in the range 1 to ncoord . |
[in] | options | Pointer to a null-terminated string containing an optional comma-separated list of attribute assignments to be used for initialising the new WcsMap. The syntax used is identical to that for the astSet function and may include "printf" format specifiers identified by "%" symbols in the normal way. If the sky projection to be implemented requires projection parameter values to be set, then this should normally be done here via the PVi_m attribute (see the "Examples" section). Setting values for these parameters is mandatory if they do not have default values (as defined in the FITS-WCS paper). |
auto wcsmap = ast::WcsMap(2, WcsType::MER, 1, 2, "")
Create a WcsMap that implements a FITS-WCS Mercator projection on pairs of coordinates, with coordinates 1 and 2 representing the longitude and latitude respectively. Note that the FITS-WCS Mercator projection does not require any projection parameters.
auto wcsmap = ast::WcsMap(3, WcsType::COE, 2, 3, "PV3_1=40.0")
Create a WcsMap that implements a FITS-WCS conical equal area projection. The WcsMap acts on points in a 3-dimensional space; coordinates 2 and 3 represent longitude and latitude respectively, while the values of coordinate 1 are copied unchanged. Projection parameter 1 associatyed with the latitude axis (corresponding to FITS keyword "PV3_1") is required and has no default, so is set explicitly to 40.0 degrees. Projection parameter 2 (corresponding to FITS keyword "PV3_2") is required but has a default of zero, so need not be specified.
|
inlineoverrideprotectedvirtual |
Return a deep copy of this object. This is called by copy.
Each subclass must override this method. The standard implementation is:
for example Frame implements this as:
Reimplemented from ast::Mapping.
|
inline |
|
inline |
Get WcsAxis(lonlat) FITS-WCS projection axis for longitude, latitude.