Projection.h

Classes

Projection -- Geometric parameters needed for a sky projection to a plane (full description)

class Projection

Types

enum Type

AZP
Zenithal/Azimuthal perspective.
TAN
Gnomonic.
SIN
Orthographics/synthesis.
STG
Stereographic.
ARC
zenith/azimuthal equidistant.
ZPN
zenithal/azimuthal polynomial.
ZEA
zenithal/azimuthal equal area.
AIR
Airy.
CYP
Cylindrical perspective.
CAR
Cartesian.
MER
Mercator.
CEA
Cylindrical equal area.
COP
Conic perspective.
COD
Conic equidistant.
COE
Conic equal area.
COO
Conic orthomorphic.
BON
Bonne.
PCO
Polyconic.
SFL
Sanson-Flamsteed (global sinusoidal). The old GLS projection is now SFL. The 'GLS' string will be converted to 'SFL'
PAR
Parabolic.
AIT
Hammer-Aitoff.
MOL
Molweide.
CSC
COBE quadrilateralized spherical cube.
QSC
Quadrilateralized spherical cube.
TSC
Tangential spherical cube.
N_PROJ
N_PROJ gives the number of supported projections - it shouldn't be used as a projection

Interface

Public Members
Projection(Projection::Type which=CAR)
Projection(const String& ctypeLin, const String& ctypeLat, const Vector<Double>& parameters)
Projection(Projection::Type which, const Vector<Double> &parameters)
Projection(const Projection &other)
Projection &operator=(const Projection &other)
~Projection()
Projection::Type type() const
String name() const
static String name(Projection::Type proj)
static Projection::Type type(const String &name)
static uInt nParameters(Projection::Type proj)
const Vector<Double> &parameters() const
Bool near(const Projection &other, Double tol=1.0e-6) const
static Bool isZenithal (Projection::Type proj)
Private Members
void validate()
Projection::Type type (String& ctypeLong, String& ctypeLat) const

Description

Review Status

Reviewed By:
Peter Barnes
Date Reviewed:
1999/12/24
Programs:
Tests:

Prerequisite

Synopsis

This class is used to hold:
  1. The type of the projection (e.g. SIN); and
  2. The parameters of the projection, if any. These parameters are described by Calabretta and Greisen (called PROJP) in the 1996 draft. In the recent versions, this paper has split into three, and the projection parameters have been reworked into the PV matrix. However, these have not yet been implemented in WCSLIB so we stick with the old ones for now.

Example

    Projection proj(Projection::CAR);
    cerr << proj.parameters() << endl;
This projection requires no parameters so the printed parameter vector would be of zero length.

Thrown Exceptions

To Do

Member Description

enum Type

Hold all the known types of celestial projections.

Projection(Projection::Type which=CAR)

Construct a projection which needs no parameters. SIN is unique in that it can be created with 0 or 2 parameters.

Projection(const String& ctypeLin, const String& ctypeLat, const Vector<Double>& parameters)

Construct a projection from FITS CTYPE keywords

Projection(Projection::Type which, const Vector<Double> &parameters)

Construct a projection which needs parameters. The parameter vector must be the length of the required number of parameters.

Projection(const Projection &other)

Copy constructor (copy semantics).

Projection &operator=(const Projection &other)

Assignment (copy semantics)

~Projection()

Destructor

Projection::Type type() const

What is the Type of this projection?

String name() const
static String name(Projection::Type proj)

What is the type of this projection as a String (e.g. "SIN").

static Projection::Type type(const String &name)

Turn a projection type name into a Type. Returns N_PROJ if the projection is not known.

static uInt nParameters(Projection::Type proj)
const Vector<Double> &parameters() const

How many parameters does this projection have, and what are they?

Bool near(const Projection &other, Double tol=1.0e-6) const

Comparison to fractional tolerance.

static Bool isZenithal (Projection::Type proj)

Is this projection a 'zenithal' projection

void validate()

Projection::Type type (String& ctypeLong, String& ctypeLat) const