casacore
Loading...
Searching...
No Matches
casacore::Projection Class Reference

More...

#include <Projection.h>

Public Types

enum  Type {
  AZP ,
  SZP ,
  TAN ,
  SIN ,
  STG ,
  ARC ,
  ZPN ,
  ZEA ,
  AIR ,
  CYP ,
  CAR ,
  MER ,
  CEA ,
  COP ,
  COD ,
  COE ,
  COO ,
  BON ,
  PCO ,
  SFL ,
  PAR ,
  AIT ,
  MOL ,
  CSC ,
  QSC ,
  TSC ,
  HPX ,
  N_PROJ
}
 Hold all the known types of celestial projections. More...
 

Public Member Functions

 Projection (Projection::Type which=CAR)
 Construct a projection which needs no 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.
 
 Projection (const Projection &other)
 Copy constructor (copy semantics).
 
Projectionoperator= (const Projection &other)
 Assignment (copy semantics)
 
 ~Projection ()
 Destructor.
 
Projection::Type type () const
 What is the Type of this projection?
 
String name () const
 What is the type of this projection as a String (e.g.
 
const Vector< Double > & parameters () const
 
Bool near (const Projection &other, Double tol=1.0e-6) const
 Comparison to fractional tolerance.
 

Static Public Member Functions

static String name (Projection::Type proj)
 
static Projection::Type type (const String &name)
 Turn a projection type name into a Type.
 
static uInt nParameters (Projection::Type proj)
 How many parameters does this projection have at most? What is the minimum number of parameters that have to be supplied? What are the parameter values?
 
static uInt nMinParameters (Projection::Type proj)
 
static Bool isZenithal (Projection::Type proj)
 Is this projection a 'zenithal' projection.
 

Private Member Functions

void validate (const Bool verbose=False)
 
Projection::Type type (String &ctypeLong, String &ctypeLat) const
 

Private Attributes

Projection::Type which_p
 
Vector< Doubleparameters_p
 

Detailed Description

Geometric parameters needed for a sky projection to a plane

Intended use:

Public interface

Review Status

Reviewed By:
Peter Barnes
Date Reviewed:
1999/12/24
Test programs:
tProjection

Prerequisite

  • Knowledge of astronomical coordinate conversions in general. Probably the best documents are the papers by Mark Calabretta and Eric Greisen. The initial draft from 1996 can be found at http://www.atnf.csiro.au/~mcalabre. It is this draft that the Coordinate classes are based upon. Since then, this paper has evolved into three which can be found at the above address, and will be published in the Astronomy and Astrophysics Supplement Series (probably in 2000). The design has changed since the initial draft. When these papers are finalized, and the IAU has ratified the new standards, WCSLIB (Mark Calabretta's implementation of these conventions) will be revised for the new designs. At that time, the Coordinate classes may also be revised.

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

cerr << proj.parameters() << endl;
@ CAR
Plate carree.
Definition Projection.h:119

This projection requires no parameters so the printed parameter vector would be of zero length.

Thrown Exceptions

To Do

  • Worry about projection parameters which are unit dependent (i.e. radians vs. degrees).
  • LONGPOLE should probably go in here.

Definition at line 93 of file Projection.h.

Member Enumeration Documentation

◆ Type

Hold all the known types of celestial projections.

Enumerator
AZP 

Zenithal/Azimuthal perspective.

SZP 

Slant zenithal perspective, new.

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 

Plate carree.

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 

Mollweide.

CSC 

COBE quadrilateralized spherical cube.

QSC 

Quadrilateralized spherical cube.

TSC 

Tangential spherical cube.

HPX 

HEALPix grid.

N_PROJ 

N_PROJ gives the number of supported projections - it shouldn't be used as a projection.

Definition at line 97 of file Projection.h.

Constructor & Destructor Documentation

◆ Projection() [1/4]

casacore::Projection::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() [2/4]

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

Construct a projection from FITS CTYPE keywords.

◆ Projection() [3/4]

casacore::Projection::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() [4/4]

casacore::Projection::Projection ( const Projection & other)

Copy constructor (copy semantics).

◆ ~Projection()

casacore::Projection::~Projection ( )

Destructor.

Member Function Documentation

◆ isZenithal()

static Bool casacore::Projection::isZenithal ( Projection::Type proj)
static

Is this projection a 'zenithal' projection.

◆ name() [1/2]

String casacore::Projection::name ( ) const

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

"SIN").

◆ name() [2/2]

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

◆ near()

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

Comparison to fractional tolerance.


◆ nMinParameters()

static uInt casacore::Projection::nMinParameters ( Projection::Type proj)
static

◆ nParameters()

static uInt casacore::Projection::nParameters ( Projection::Type proj)
static

How many parameters does this projection have at most? What is the minimum number of parameters that have to be supplied? What are the parameter values?

◆ operator=()

Projection & casacore::Projection::operator= ( const Projection & other)

Assignment (copy semantics)

◆ parameters()

const Vector< Double > & casacore::Projection::parameters ( ) const
inline

Definition at line 217 of file Projection.h.

References parameters_p.

◆ type() [1/3]

Projection::Type casacore::Projection::type ( ) const
inline

What is the Type of this projection?

Definition at line 216 of file Projection.h.

References which_p.

◆ type() [2/3]

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

Turn a projection type name into a Type.

Returns N_PROJ if the projection is not known.

◆ type() [3/3]

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

◆ validate()

void casacore::Projection::validate ( const Bool verbose = False)
private

Member Data Documentation

◆ parameters_p

Vector<Double> casacore::Projection::parameters_p
private

Definition at line 209 of file Projection.h.

Referenced by parameters().

◆ which_p

Projection::Type casacore::Projection::which_p
private

Definition at line 208 of file Projection.h.

Referenced by type().


The documentation for this class was generated from the following file: