casacore
Aberration.h
Go to the documentation of this file.
1 //# Aberration.h: Aberration class
2 //# Copyright (C) 1995,1996,1997,1998
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 //#
27 //# $Id$
28 
29 #ifndef MEASURES_ABERRATION_H
30 #define MEASURES_ABERRATION_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Quanta/MVPosition.h>
35 
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 // <summary>
40 // Aberration class and calculations
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
46 // </reviewed>
47 
48 // <prerequisite>
49 // <li> <linkto class=Measure>Measure</linkto> class,
50 // especially <linkto class=MEpoch>MEpoch</linkto>
51 // <li> <linkto class=MeasData>MeasData</linkto> class for constants
52 // </prerequisite>
53 //
54 // <etymology>
55 // Aberration
56 // </etymology>
57 //
58 // <synopsis>
59 // Aberration forms the class for Aberration calculations. It is a simple
60 // container with the selected method, and the mean epoch.<br>
61 // The method is selected from one of the following:
62 // <ul>
63 // <li> Aberration::STANDARD (at 1995/09/04 the IAU1980 definition)
64 // <li> Aberration::NONE
65 // <li> Aberration::B1950
66 // </ul>
67 // Epochs can be specified as the MJD (with defined constants MeasData::MJD2000
68 // and MeasData::MJDB1950 or the actual MJD),
69 // leading to the following constructors:
70 // <ul>
71 // <li> Aberration() default; assuming JD2000, IAU1980
72 // <li> Aberration(method) assuming the correct default epoch of
73 // JD2000 or B1950
74 // <li> Aberration(method,epoch) with epoch Double(MJD).
75 // </ul>
76 // Actual Aberration for a certain Epoch is calculated by the () operator
77 // as Aberration(epoch), with epoch Double MJD, values returned as an
78 // MVPosition.<br>
79 // The derivative (d<sup>-1</sup>) can be obtained as well by
80 // derivative(epoch).<br>
81 // The following details can be set with the
82 // <linkto class=Aipsrc>Aipsrc</linkto> mechanism:
83 // <ul>
84 // <li> measures.aberration.d_interval: approximation interval as time
85 // (fraction of days is default unit) over which linear approximation
86 // is used
87 // <li> measures.aberration.b_usejpl: use the JPL database values for IAU1980.
88 // Else analytical expression, relative error about 10<sup>-9</sup>
89 // Note that the JPL database to be used can be set with
90 // measures.jpl.ephemeris (at the moment of writing DE200 (default),
91 // or DE405). If using the JPL database, the d_interval (and the
92 // output of derivative()) are irrelevant.
93 // </ul>
94 // </synopsis>
95 //
96 // <example>
97 // </example>
98 //
99 // <motivation>
100 // To calculate the Aberration angles. An alternate route could have been
101 // a global function, but having a simple container allows
102 // caching of some calculations for speed.<br>
103 // Using MJD (JD-2400000.5) rather than JD is for precision reasons.
104 // </motivation>
105 //
106 // <todo asof="1997/12/02">
107 // </todo>
108 
110 {
111 public:
112 //# Constants
113 // Interval to be used for linear approximation (in days)
114  static const Double INTV;
115 
116 //# Enumerations
117 // Types of known Aberration calculations (at 1995/09/04 STANDARD == IAU1980)
119 
120 //# Constructors
121 // Default constructor, generates default J2000 Aberration identification
123 // Copy constructor
124  Aberration(const Aberration &other);
125 // Constructor with type
127 // Copy assignment
129 
130 //# Destructor
132 
133 //# Operators
134 // Operator () calculates the Aberration direction cosine vector
135  const MVPosition &operator()(Double epoch);
136 
137 //# General Member Functions
138 // Return derivative of Aberration (d<sup>-1</sup>) w.r.t. time
139  const MVPosition &derivative (Double epoch);
140 
141 // Re-initialise Aberration object
142 // <group>
143  void init();
144  void init(AberrationTypes type);
145 // </group>
146 
147 // Refresh calculations
148  void refresh();
149 
150 private:
151 //# Data menbers
152 // Method to be used
154 // Check epoch for linear approximation
156 // Cached calculated angles
158 // Cached derivatives
160 // To be able to use referenced results in simple calculations, a circular
161 // result buffer is used.
162 // Current buffer pointer.
164 // Last calculation
166 // Interpolation interval
168 // JPL use
169  static uInt usejpl_reg;
170 
171 //# Member functions
172 // Copy
173  void copy(const Aberration &other);
174 // Fill an empty copy
175  void fill();
176 // Calculate Aberration angles for time t
177  void calcAber(Double t);
178 };
179 
180 
181 } //# NAMESPACE CASACORE - END
182 
183 #endif
184 
185 
void calcAber(Double t)
Calculate Aberration angles for time t.
Double dval[3]
Cached derivatives.
Definition: Aberration.h:159
Aberration(const Aberration &other)
Copy constructor.
void copy(const Aberration &other)
Copy.
MVPosition result[4]
Last calculation.
Definition: Aberration.h:165
void fill()
Fill an empty copy.
Double checkEpoch
Check epoch for linear approximation.
Definition: Aberration.h:155
Aberration()
Default constructor, generates default J2000 Aberration identification.
const MVPosition & operator()(Double epoch)
Operator () calculates the Aberration direction cosine vector.
static uInt usejpl_reg
JPL use.
Definition: Aberration.h:169
static uInt interval_reg
Interpolation interval.
Definition: Aberration.h:167
AberrationTypes method
Method to be used.
Definition: Aberration.h:153
const MVPosition & derivative(Double epoch)
Return derivative of Aberration (d-1) w.r.t.
static const Double INTV
Interval to be used for linear approximation (in days)
Definition: Aberration.h:114
Double aval[3]
Cached calculated angles.
Definition: Aberration.h:157
Aberration & operator=(const Aberration &other)
Copy assignment.
Int lres
To be able to use referenced results in simple calculations, a circular result buffer is used.
Definition: Aberration.h:163
void refresh()
Refresh calculations.
void init()
Re-initialise Aberration object.
AberrationTypes
Types of known Aberration calculations (at 1995/09/04 STANDARD == IAU1980)
Definition: Aberration.h:118
void init(AberrationTypes type)
Aberration(AberrationTypes type)
Constructor with type.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
int Int
Definition: aipstype.h:50
double Double
Definition: aipstype.h:55