casacore
Loading...
Searching...
No Matches
ParAngleMachine.h
Go to the documentation of this file.
1// # ParAngleMachine.h: Converts a direction into parallactic angle
2// # Copyright (C) 2001,2002
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#ifndef MEASURES_PARANGLEMACHINE_H
26#define MEASURES_PARANGLEMACHINE_H
27
28// # Includes
29#include <casacore/casa/aips.h>
30#include <casacore/measures/Measures.h>
31#include <casacore/measures/Measures/MCDirection.h>
32#include <casacore/measures/Measures/MDirection.h>
33#include <casacore/measures/Measures/MCEpoch.h>
34#include <casacore/measures/Measures/MEpoch.h>
35#include <casacore/casa/Quanta/Quantum.h>
36#include <casacore/casa/Quanta/MVDirection.h>
37#include <casacore/casa/Quanta/MVEpoch.h>
38#include <casacore/casa/Arrays/Vector.h>
39
40namespace casacore { // # NAMESPACE CASACORE - BEGIN
41
42// # Forward Declarations
43class MeasFrame;
44
45// <summary> Converts a direction into parallactic angle
46// </summary>
47
48// <use visibility=export>
49
50// <reviewed reviewer="Mark Wieringa" date="2001/10/06" tests="tParAngleMachine.cc" demos="">
51// </reviewed>
52
53// <prerequisite>
54// <li> <linkto class=MDirection>MDirection</linkto> class
55// </prerequisite>
56//
57// <etymology>
58// From Parallactic Angle and machinery
59// </etymology>
60//
61// <synopsis>
62// The construction of a ParAngleMachine class object creates a machine that
63// can create parallactic angles from a series of time epochs given.
64//
65// The machinery needs an input
66// <linkto class=MDirection>MDirection</linkto> to specify the input
67// coordinates reference direction and coordinate system.
68// The parallactic (<em>vertical</em>)
69// angle will be calculated as the angle between the vertical in the
70// local coordinate system (<em>Az, El</em>) through the given direction and
71// the pole of the <em>J2000</em> coordinate system.
72// <note role=tip> To calculate the parallactic angle for another
73// coordinate system pole, add the <src>positionAngle</src> between the
74// <em>J2000</em> system and the pole in the other coordinate system. </note>
75//
76// The machinery also needs a <linkto class=MeasFrame>MeasFrame</linkto>,
77// with a position on Earth and
78// a reference epoch. The reference time is necessary to have an epoch type.
79//
80// The actual calculation of the parallactic angles is done by the
81// <src>operator()</src> accepting a time or a list of times in various
82// formats.
83//
84// The machine calculates the paralaactic angle for the first time given to
85// the machine. For subsequent times that are within a check interval,
86// the angle is calculated assuming that only the hour angle changes within
87// that interval. For moving objects the test interval is always forced
88// to zero. Tests show that the machine with a zero interval is about
89// 8 times faster than using brute force. Having an interval of an
90// hour improves that by another factor of 4.
91// <note role=tip> If the parallactic angles for a series of directions have
92// to be calculated, it is best to have separate machines for each such
93// <em>field</em>. </note>
94// </synopsis>
95//
96// <example>
97// <srcblock>
98// </srcblock>
99// </example>
100//
101// <motivation>
102// To speed up parallactic angle calculations
103// </motivation>
104//
105// <todo asof="2001/09/15">
106// <li>
107// </todo>
108
110 public:
111 // # Constructors
112 // Create an empty machine. It can only be used after appropriate 'set'
113 // methods
115 // Construct for the specified direction
117 // Copy constructor (deep copy)
119 // Copy assignments (deep copy)
121
122 // # Destructor
124
125 // # Operators
126 // Return parallactic angles (epoch in days if given as Double)
127 // <thrown>
128 // <li> AipsError if no frame or a frame without an Epoch (for type) or
129 // Position.
130 // </thrown>
131 // <group>
138 Double operator()(const Double &ep) const;
140 // </group>
141
142 // # Member functions
143 // Will have a group of set methods (in direction; reference time; a frame;
144 // a reference time valid period
145 // <group>
146 void set(const MDirection &in);
147 void set(const MeasFrame &frame);
148 // </group>
149 // Set the test interval (in days) over which to use simple formula
150 void setInterval(const Double ttime);
151
152 private:
153 // # Data
154 // Input direction
156 // Conversion engine
158 // Measure frame
160 // Converted zenith
162 // Intermediate conversion result
164 // Time of last full solution (in days)
166 // Default time interval over which to do simple solution (days)
168 // Time interval over which to do simple solution (days)
170 // Calculation cache
171 // <group>
179 // </group>
180
181 // # Constructors
182
183 // # Private Member Functions
184 // Get position angle (Epoch is supposed to be in days if Double)
185 // <thrown>
186 // <li> AipsError if no frame or a frame without an Epoch (for type) or
187 // Position.
188 // </thrown>
189 // <group>
192 Double posAngle(const Double &ep) const;
194 // </group>
195 // Initialise machinery
196 void init();
197 // Initialise conversion
198 void initConv() const;
199 // Calculate position angle
200 Double calcAngle(const Double ep) const;
201};
202
203} // namespace casacore
204
205#endif
MeasConvert< MDirection > Convert
Measure Convert (i.e.
Definition MDirection.h:244
Double posAngle(const Double &ep) const
MVDirection zenith_p
Converted zenith.
Double calcAngle(const Double ep) const
Calculate position angle.
Vector< Double > operator()(const Vector< Double > &ep) const
Double posAngle(const Quantum< Double > &ep) const
Get position angle (Epoch is supposed to be in days if Double).
ParAngleMachine(const ParAngleMachine &other)
Copy constructor (deep copy).
Double operator()(const Double &ep) const
ParAngleMachine & operator=(const ParAngleMachine &other)
Copy assignments (deep copy).
Double intvl_p
Time interval over which to do simple solution (days).
MeasFrame * frame_p
Measure frame.
void initConv() const
Initialise conversion.
Double lastep_p
Time of last full solution (in days).
Double defintvl_p
Default time interval over which to do simple solution (days).
Double UTfactor_p
Calculation cache.
Quantum< Vector< Double > > operator()(const Quantum< Vector< Double > > &ep) const
Return parallactic angles (epoch in days if given as Double).
ParAngleMachine(const MDirection &in)
Construct for the specified direction.
Quantum< Vector< Double > > operator()(const Vector< MEpoch > &ep) const
void setInterval(const Double ttime)
Set the test interval (in days) over which to use simple formula.
ParAngleMachine()
Create an empty machine.
Quantum< Double > operator()(const MEpoch &ep) const
void set(const MDirection &in)
Will have a group of set methods (in direction; reference time; a frame; a reference time valid perio...
MDirection::Convert * convdir_p
Conversion engine.
Vector< Double > posAngle(const Quantum< Vector< Double > > &ep) const
Quantum< Double > operator()(const Quantum< Double > &ep) const
MVDirection mvdir_p
Intermediate conversion result.
Vector< Double > posAngle(const Vector< Double > &ep) const
Quantum< Double > operator()(const MVEpoch &ep) const
void set(const MeasFrame &frame)
void init()
Initialise machinery.
MDirection * indir_p
Input direction.
Quantum< Vector< Double > > operator()(const Vector< MVEpoch > &ep) const
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
double Double
Definition aipstype.h:53