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