casacore
Loading...
Searching...
No Matches
Projection.h
Go to the documentation of this file.
1//# Projection.h: Geometric parameters needed for a sky projection to a plane
2//# Copyright (C) 1997,1998,1999,2000,2001,2003
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef COORDINATES_PROJECTION_H
27#define COORDINATES_PROJECTION_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Arrays/Vector.h>
31#include <casacore/casa/BasicSL/String.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35
36// <summary>
37// Geometric parameters needed for a sky projection to a plane
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="Peter Barnes" date="1999/12/24" tests="tProjection">
43// </reviewed>
44//
45// <prerequisite>
46// <li> Knowledge of astronomical coordinate conversions in general. Probably the
47// best documents are the papers by Mark Calabretta and Eric Greisen.
48// The initial draft from 1996 can be found at
49// http://www.atnf.csiro.au/~mcalabre. It is this draft that the
50// Coordinate classes are based upon. Since then, this paper has evolved
51// into three which can be found at the above address, and will be published in the
52// Astronomy and Astrophysics Supplement Series (probably in 2000).
53// The design has changed since the initial draft. When these papers
54// are finalized, and the IAU has ratified the new standards, WCSLIB
55// (Mark Calabretta's implementation of these conventions) will be
56// revised for the new designs. At that time, the Coordinate classes
57// may also be revised.
58// </prerequisite>
59//
60// <synopsis>
61// This class is used to hold:
62// <ol>
63// <li> The type of the projection (e.g. SIN); and
64// <li> The parameters of the projection, if any. These parameters are described
65// by Calabretta and Greisen (called PROJP) in the 1996 draft.
66// In the recent versions, this paper has split into three, and the
67// projection parameters have been reworked into the PV matrix.
68// However, these have not yet been implemented in WCSLIB so we
69// stick with the old ones for now.
70// </ol>
71// </synopsis>
72//
73// <example>
74// <srcblock>
75// Projection proj(Projection::CAR);
76// cerr << proj.parameters() << endl;
77// </srcblock>
78// This projection requires no parameters so the printed parameter
79// vector would be of zero length.
80// </example>
81//
82// <thrown>
83// <li> AipsError
84// </thrown>
85//
86// <todo asof="2000/01/01">
87// <li> Worry about projection parameters which are unit dependent (i.e.
88// radians vs. degrees).
89// <li> LONGPOLE should probably go in here.
90// </todo>
91//
92
94{
95public:
96 // Hold all the known types of celestial projections.
97 enum Type {
98 // Zenithal/Azimuthal perspective.
100 // Slant zenithal perspective, new
102 // Gnomonic.
104 // Orthographics/synthesis.
106 // Stereographic.
108 // zenith/azimuthal equidistant.
110 // zenithal/azimuthal polynomial.
112 // zenithal/azimuthal equal area.
114 // Airy.
116 // Cylindrical perspective.
118 // Plate carree
120 // Mercator.
122 // Cylindrical equal area.
124 // Conic perspective.
126 // Conic equidistant.
128 // Conic equal area.
130 // Conic orthomorphic.
132 // Bonne.
134 // Polyconic.
136 // Sanson-Flamsteed (global sinusoidal).
137 // The old GLS projection is now SFL. The 'GLS'
138 // string will be converted to 'SFL'
140 // Parabolic.
142 // Hammer-Aitoff.
144 // Mollweide.
146 // COBE quadrilateralized spherical cube.
148 // Quadrilateralized spherical cube.
150 // Tangential spherical cube.
152 // HEALPix grid
154 // N_PROJ gives the number of supported projections - it shouldn't be used
155 // as a projection
157
158 // Construct a projection which needs no parameters. SIN is unique in that
159 // it can be created with 0 or 2 parameters.
161
162 // Construct a projection from FITS CTYPE keywords
163 Projection(const String& ctypeLin, const String& ctypeLat,
165
166 // Construct a projection which needs parameters. The parameter vector must be
167 // the length of the required number of parameters.
169
170 // Copy constructor (copy semantics).
171 Projection(const Projection &other);
172
173 // Assignment (copy semantics)
175
176 // Destructor
178
179 // What is the Type of this projection?
180 Projection::Type type() const;
181
182 // What is the type of this projection as a String (e.g. "SIN").
183 // <group>
184 String name() const;
186 // </group>
187
188 // Turn a projection type name into a Type.
189 // Returns N_PROJ if the projection is not known.
191
192 // How many parameters does this projection have at most?
193 // What is the minimum number of parameters that have to be supplied?
194 // What are the parameter values?
195 // <group>
198 const Vector<Double> &parameters() const;
199 // </group>
200
201 // Comparison to fractional tolerance.
202 Bool near(const Projection &other, Double tol=1.0e-6) const;
203
204 // Is this projection a 'zenithal' projection
206
207private:
210
211 void validate(const Bool verbose=False);
212 Projection::Type type (String& ctypeLong, String& ctypeLat) const;
213};
214
215//#---------- Inlines --------------------------------------------------------------
217inline const Vector<Double> & Projection::parameters() const {return parameters_p;}
218
219} //# NAMESPACE CASACORE - END
220
221#endif
222
const Vector< Double > & parameters() const
Definition Projection.h:217
static Bool isZenithal(Projection::Type proj)
Is this projection a 'zenithal' projection.
static uInt nMinParameters(Projection::Type proj)
Type
Hold all the known types of celestial projections.
Definition Projection.h:97
@ CSC
COBE quadrilateralized spherical cube.
Definition Projection.h:147
@ COP
Conic perspective.
Definition Projection.h:125
@ CAR
Plate carree.
Definition Projection.h:119
@ COO
Conic orthomorphic.
Definition Projection.h:131
@ AIT
Hammer-Aitoff.
Definition Projection.h:143
@ SZP
Slant zenithal perspective, new.
Definition Projection.h:101
@ COE
Conic equal area.
Definition Projection.h:129
@ ZPN
zenithal/azimuthal polynomial.
Definition Projection.h:111
@ TSC
Tangential spherical cube.
Definition Projection.h:151
@ ARC
zenith/azimuthal equidistant.
Definition Projection.h:109
@ QSC
Quadrilateralized spherical cube.
Definition Projection.h:149
@ CYP
Cylindrical perspective.
Definition Projection.h:117
@ ZEA
zenithal/azimuthal equal area.
Definition Projection.h:113
@ CEA
Cylindrical equal area.
Definition Projection.h:123
@ SFL
Sanson-Flamsteed (global sinusoidal).
Definition Projection.h:139
@ AZP
Zenithal/Azimuthal perspective.
Definition Projection.h:99
@ SIN
Orthographics/synthesis.
Definition Projection.h:105
@ STG
Stereographic.
Definition Projection.h:107
@ HPX
HEALPix grid.
Definition Projection.h:153
@ COD
Conic equidistant.
Definition Projection.h:127
@ N_PROJ
N_PROJ gives the number of supported projections - it shouldn't be used as a projection.
Definition Projection.h:156
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.
static uInt nParameters(Projection::Type proj)
How many parameters does this projection have at most? What is the minimum number of parameters that ...
~Projection()
Destructor.
Projection & operator=(const Projection &other)
Assignment (copy semantics)
Bool near(const Projection &other, Double tol=1.0e-6) const
Comparison to fractional tolerance.
static Projection::Type type(const String &name)
Turn a projection type name into a Type.
Projection::Type which_p
Definition Projection.h:208
Projection::Type type(String &ctypeLong, String &ctypeLat) const
Vector< Double > parameters_p
Definition Projection.h:209
String name() const
What is the type of this projection as a String (e.g.
Projection(Projection::Type which=CAR)
Construct a projection which needs no parameters.
Projection(const Projection &other)
Copy constructor (copy semantics).
Projection::Type type() const
What is the Type of this projection?
Definition Projection.h:216
void validate(const Bool verbose=False)
static String name(Projection::Type proj)
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53