casacore
Loading...
Searching...
No Matches
SolarPos.h
Go to the documentation of this file.
1//# SolarPos.h: Solar position 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: 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 MEASURES_SOLARPOS_H
27#define MEASURES_SOLARPOS_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Quanta/MVPosition.h>
32
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary> Solar position class and calculations </summary>
37
38// <use visibility=export>
39
40// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
41// </reviewed>
42
43// <prerequisite>
44// <li> <linkto class=Measure>Measure</linkto> class,
45// especially <linkto class=MEpoch>MEpoch</linkto>
46// <li> <linkto class=MeasData>MeasData</linkto> class for constants
47// </prerequisite>
48//
49// <etymology>
50// SolarPos from Solar Position
51// </etymology>
52//
53// <synopsis>
54// SolarPos forms the class for Solar Position calculations. It is a simple
55// container with the selected method, and the mean epoch.<br>
56// The method is selected from one of the following:
57// <ul>
58// <li> SolarPos::STANDARD (at 1995/09/04 the IAU1980 definition)
59// <li> SolarPos::NONE
60// </ul>
61// Epochs can be specified as the MJD (with defined constants MeasData::MJD2000
62// and MeasData::MJDB1950 or the actual MJD),
63// leading to the following constructors:
64// <ul>
65// <li> SolarPos() default; assuming JD2000, IAU1980
66// <li> SolarPos(method) assuming the correct default epoch of
67// JD2000
68// <li> SolarPos(method,epoch) with epoch Double(MJD)
69// </ul>
70// Actual SolarPos for a certain Epoch is calculated by the () operator
71// as SolarPos(epoch), with epoch Double MJD, as an MVPosition vector.<br>
72// It returns the geocentric position of the heliocentre in rectangular
73// coordinates in AU.<br>
74// The derivative (d<sup>-1</sup>) can be obtained as well by
75// derivative(epoch), baryEarthDerivative() and barySunDerivative().<br>
76// The Earth's and solar barycentric position can be obtained by the
77// members <src>baryEarth</src> and <src>barySun</src>.
78// The following details can be set with the
79// <linkto class=Aipsrc>Aipsrc</linkto> mechanism:
80// <ul>
81// <li> measures.solarpos.d_interval: approximation interval as time
82// (fraction of days is default unit) over which linear approximation
83// is used
84// <li> measures.solarpos.b_usejpl: use the JPL database for solar position.
85// Else analytical expression, relative error about 10<sup>-9</sup>
86// Note that the JPL database to be used can be set with
87// measures.jpl.ephemeris (at the moment of writing DE200 (default),
88// or DE405)
89// </ul>
90// Reference: M. Soma et al., Cel. Mech. 41 (1988), 389;
91// E.M. Standish, Astron. Astroph. 114 (1982), 297.
92// </synopsis>
93//
94// <example>
95// </example>
96//
97// <motivation>
98// To calculate the solar/Earth positions for gravitational deflection.
99// An alternate route could have been
100// a global function, but having a simple container allows
101// caching of some calculations for speed.<br>
102// Using MJD (JD-2400000.5) rather than JD is for precision reasons.
103// </motivation>
104//
105// <todo asof="1996/02/18">
106// </todo>
107
108class SolarPos {
109public:
110//# Constants
111// Interval to be used for linear approximation (in days)
112 static const Double INTV;
113
114//# Enumerations
115// Types of known SolarPos calculations (at 1995/09/04 STANDARD == IAU1980)
117
118//# Constructors
119// Default constructor, generates default J2000 SolarPos identification
121// Copy constructor
122 SolarPos(const SolarPos &other);
123// Constructor with type
125// Copy assignment
127
128//# Destructor
130
131//# Operators
132// Operator () calculates the geocentric Solar Position in AU
134
135//# General Member Functions
136// <group>
137// Return derivatives of SolarPos (d<sup>-1</sup>)
141// </group>
142// Barycentric position of Earth
144// Barycentric position of Sun
145 const MVPosition &barySun(Double epoch);
146
147// Re-initialise SolarPos object
148// <group>
149 void init();
150 void init(SolarPosTypes type);
151// </group>
152
153// Refresh calculations
154 void refresh();
155
156private:
157//# Data menbers
158// Method to be used
160// Check epoch for linear approximation
163// Cached calculated Earth positions
165// Cached derivatives
167// Cached calculated Sun positions
169// Cached derivatives
171// To be able to use references in simple calculations, results are calculated
172// in a circular buffer.
173// Current buffer pointer
175// Last calculation
177// Interpolation interval
179// JPL use
181
182//# Member functions
183// Copy
184 void copy(const SolarPos &other);
185// Fill an empty copy
186 void fill();
187// Calculate heliocentric Earth position for time t
189// Calculate heliocentric barycentre position
191};
192
193
194} //# NAMESPACE CASACORE - END
195
196#endif
SolarPos(const SolarPos &other)
Copy constructor.
void init(SolarPosTypes type)
const MVPosition & barySunDerivative(Double epoch)
MVPosition result[6]
Last calculation.
Definition SolarPos.h:176
void refresh()
Refresh calculations.
const MVPosition & baryEarth(Double epoch)
Barycentric position of Earth.
void calcSun(Double t)
Calculate heliocentric barycentre position.
Double sval[3]
Cached calculated Sun positions.
Definition SolarPos.h:168
Int lres
To be able to use references in simple calculations, results are calculated in a circular buffer.
Definition SolarPos.h:174
static const Double INTV
Interval to be used for linear approximation (in days)
Definition SolarPos.h:112
void copy(const SolarPos &other)
Copy.
Double checkEpoch
Check epoch for linear approximation.
Definition SolarPos.h:161
const MVPosition & operator()(Double epoch)
Operator () calculates the geocentric Solar Position in AU.
void init()
Re-initialise SolarPos object.
SolarPosTypes
Types of known SolarPos calculations (at 1995/09/04 STANDARD == IAU1980)
Definition SolarPos.h:116
static uInt interval_reg
Interpolation interval.
Definition SolarPos.h:178
const MVPosition & derivative(Double epoch)
Return derivatives of SolarPos (d-1)
static uInt usejpl_reg
JPL use.
Definition SolarPos.h:180
Double dsval[3]
Cached derivatives.
Definition SolarPos.h:170
SolarPos & operator=(const SolarPos &other)
Copy assignment.
const MVPosition & barySun(Double epoch)
Barycentric position of Sun.
SolarPosTypes method
Method to be used.
Definition SolarPos.h:159
const MVPosition & baryEarthDerivative(Double epoch)
void fill()
Fill an empty copy.
void calcEarth(Double t)
Calculate heliocentric Earth position for time t.
SolarPos(SolarPosTypes type)
Constructor with type.
SolarPos()
Default constructor, generates default J2000 SolarPos identification.
Double deval[3]
Cached derivatives.
Definition SolarPos.h:166
Double eval[3]
Cached calculated Earth positions.
Definition SolarPos.h:164
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
double Double
Definition aipstype.h:53