VieSched++
VieVS VLBI Scheduling Software
sofam.h
Go to the documentation of this file.
1 #ifndef SOFAMHDEF
2 #define SOFAMHDEF
3 
4 /*
5 ** - - - - - - - -
6 ** s o f a m . h
7 ** - - - - - - - -
8 **
9 ** Macros used by SOFA library.
10 **
11 ** This file is part of the International Astronomical Union's
12 ** SOFA (Standards Of Fundamental Astronomy) software collection.
13 **
14 ** Please note that the constants defined below are to be used only in
15 ** the context of the SOFA software, and have no other official IAU
16 ** status. In addition, self consistency is not guaranteed.
17 **
18 ** This revision: 2017 March 16
19 **
20 ** SOFA release 2017-04-20
21 **
22 ** Copyright (C) 2017 IAU SOFA Board. See notes at end.
23 */
24 
25 /* Star-independent astrometry parameters */
26 typedef struct {
27  double pmt; /* PM time interval (SSB, Julian years) */
28  double eb[3]; /* SSB to observer (vector, au) */
29  double eh[3]; /* Sun to observer (unit vector) */
30  double em; /* distance from Sun to observer (au) */
31  double v[3]; /* barycentric observer velocity (vector, c) */
32  double bm1; /* sqrt(1-|v|^2): reciprocal of Lorenz factor */
33  double bpn[3][3]; /* bias-precession-nutation matrix */
34  double along; /* longitude + s' + dERA(DUT) (radians) */
35  double phi; /* geodetic latitude (radians) */
36  double xpl; /* polar motion xp wrt local meridian (radians) */
37  double ypl; /* polar motion yp wrt local meridian (radians) */
38  double sphi; /* sine of geodetic latitude */
39  double cphi; /* cosine of geodetic latitude */
40  double diurab; /* magnitude of diurnal aberration vector */
41  double eral; /* "local" Earth rotation angle (radians) */
42  double refa; /* refraction constant A (radians) */
43  double refb; /* refraction constant B (radians) */
44 } iauASTROM;
45 /* (Vectors eb, eh, em and v are all with respect to BCRS axes.) */
46 
47 /* Body parameters for light deflection */
48 typedef struct {
49  double bm; /* mass of the body (solar masses) */
50  double dl; /* deflection limiter (radians^2/2) */
51  double pv[2][3]; /* barycentric PV of the body (au, au/day) */
52 } iauLDBODY;
53 
54 /* Pi */
55 #define DPI ( 3.141592653589793238462643 )
56 
57 /* 2Pi */
58 #define D2PI ( 6.283185307179586476925287 )
59 
60 /* Radians to degrees */
61 #define DR2D ( 57.29577951308232087679815 )
62 
63 /* Degrees to radians */
64 #define DD2R ( 1.745329251994329576923691e-2 )
65 
66 /* Radians to arcseconds */
67 #define DR2AS ( 206264.8062470963551564734 )
68 
69 /* Arcseconds to radians */
70 #define DAS2R ( 4.848136811095359935899141e-6 )
71 
72 /* Seconds of time to radians */
73 #define DS2R ( 7.272205216643039903848712e-5 )
74 
75 /* Arcseconds in a full circle */
76 #define TURNAS ( 1296000.0 )
77 
78 /* Milliarcseconds to radians */
79 #define DMAS2R ( DAS2R / 1e3 )
80 
81 /* Length of tropical year B1900 (days) */
82 #define DTY ( 365.242198781 )
83 
84 /* Seconds per day. */
85 #define DAYSEC ( 86400.0 )
86 
87 /* Days per Julian year */
88 #define DJY ( 365.25 )
89 
90 /* Days per Julian century */
91 #define DJC ( 36525.0 )
92 
93 /* Days per Julian millennium */
94 #define DJM ( 365250.0 )
95 
96 /* Reference epoch (J2000.0), Julian Date */
97 #define DJ00 ( 2451545.0 )
98 
99 /* Julian Date of Modified Julian Date zero */
100 #define DJM0 ( 2400000.5 )
101 
102 /* Reference epoch (J2000.0), Modified Julian Date */
103 #define DJM00 ( 51544.5 )
104 
105 /* 1977 Jan 1.0 as MJD */
106 #define DJM77 ( 43144.0 )
107 
108 /* TT minus TAI (s) */
109 #define TTMTAI ( 32.184 )
110 
111 /* Astronomical unit (m, IAU 2012) */
112 #define DAU ( 149597870.7e3 )
113 
114 /* Speed of light (m/s) */
115 #define CMPS 299792458.0
116 
117 /* Light time for 1 au (s) */
118 #define AULT ( DAU / CMPS )
119 
120 /* Speed of light (au per day) */
121 #define DC ( DAYSEC / AULT )
122 
123 /* L_G = 1 - d(TT)/d(TCG) */
124 #define ELG ( 6.969290134e-10 )
125 
126 /* L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 */
127 #define ELB ( 1.550519768e-8 )
128 #define TDB0 ( -6.55e-5 )
129 
130 /* Schwarzschild radius of the Sun (au) */
131 /* = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
132 #define SRS 1.97412574336e-8
133 
134 /* dint(A) - truncate to nearest whole number towards zero (double) */
135 #define dint( A ) ( ( A ) < 0.0 ? ceil( A ) : floor( A ) )
136 
137 /* dnint(A) - round to nearest whole number (double) */
138 #define dnint( A ) ( ( A ) < 0.0 ? ceil( (A)-0.5 ) : floor( ( A ) + 0.5 ) )
139 
140 /* dsign(A,B) - magnitude of A with sign of B (double) */
141 #define dsign( A, B ) ( ( B ) < 0.0 ? -fabs( A ) : fabs( A ) )
142 
143 /* max(A,B) - larger (most +ve) of two numbers (generic) */
144 #define gmax( A, B ) ( ( ( A ) > ( B ) ) ? ( A ) : ( B ) )
145 
146 /* min(A,B) - smaller (least +ve) of two numbers (generic) */
147 #define gmin( A, B ) ( ( ( A ) < ( B ) ) ? ( A ) : ( B ) )
148 
149 /* Reference ellipsoids */
150 #define WGS84 1
151 #define GRS80 2
152 #define WGS72 3
153 
154 #endif
155 
156 /*----------------------------------------------------------------------
157 **
158 ** Copyright (C) 2017
159 ** Standards Of Fundamental Astronomy Board
160 ** of the International Astronomical Union.
161 **
162 ** =====================
163 ** SOFA Software License
164 ** =====================
165 **
166 ** NOTICE TO USER:
167 **
168 ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
169 ** CONDITIONS WHICH APPLY TO ITS USE.
170 **
171 ** 1. The Software is owned by the IAU SOFA Board ("SOFA").
172 **
173 ** 2. Permission is granted to anyone to use the SOFA software for any
174 ** purpose, including commercial applications, free of charge and
175 ** without payment of royalties, subject to the conditions and
176 ** restrictions listed below.
177 **
178 ** 3. You (the user) may copy and distribute SOFA source code to others,
179 ** and use and adapt its code and algorithms in your own software,
180 ** on a world-wide, royalty-free basis. That portion of your
181 ** distribution that does not consist of intact and unchanged copies
182 ** of SOFA source code files is a "derived work" that must comply
183 ** with the following requirements:
184 **
185 ** a) Your work shall be marked or carry a statement that it
186 ** (i) uses routines and computations derived by you from
187 ** software provided by SOFA under license to you; and
188 ** (ii) does not itself constitute software provided by and/or
189 ** endorsed by SOFA.
190 **
191 ** b) The source code of your derived work must contain descriptions
192 ** of how the derived work is based upon, contains and/or differs
193 ** from the original SOFA software.
194 **
195 ** c) The names of all routines in your derived work shall not
196 ** include the prefix "iau" or "sofa" or trivial modifications
197 ** thereof such as changes of case.
198 **
199 ** d) The origin of the SOFA components of your derived work must
200 ** not be misrepresented; you must not claim that you wrote the
201 ** original software, nor file a patent application for SOFA
202 ** software or algorithms embedded in the SOFA software.
203 **
204 ** e) These requirements must be reproduced intact in any source
205 ** distribution and shall apply to anyone to whom you have
206 ** granted a further right to modify the source code of your
207 ** derived work.
208 **
209 ** Note that, as originally distributed, the SOFA software is
210 ** intended to be a definitive implementation of the IAU standards,
211 ** and consequently third-party modifications are discouraged. All
212 ** variations, no matter how minor, must be explicitly marked as
213 ** such, as explained above.
214 **
215 ** 4. You shall not cause the SOFA software to be brought into
216 ** disrepute, either by misuse, or use for inappropriate tasks, or
217 ** by inappropriate modification.
218 **
219 ** 5. The SOFA software is provided "as is" and SOFA makes no warranty
220 ** as to its use or performance. SOFA does not and cannot warrant
221 ** the performance or results which the user may obtain by using the
222 ** SOFA software. SOFA makes no warranties, express or implied, as
223 ** to non-infringement of third party rights, merchantability, or
224 ** fitness for any particular purpose. In no event will SOFA be
225 ** liable to the user for any consequential, incidental, or special
226 ** damages, including any lost profits or lost savings, even if a
227 ** SOFA representative has been advised of such damages, or for any
228 ** claim by any third party.
229 **
230 ** 6. The provision of any version of the SOFA software under the terms
231 ** and conditions specified herein does not imply that future
232 ** versions will also be made available under the same terms and
233 ** conditions.
234 *
235 ** In any published work or commercial product which uses the SOFA
236 ** software directly, acknowledgement (see www.iausofa.org) is
237 ** appreciated.
238 **
239 ** Correspondence concerning SOFA software should be addressed as
240 ** follows:
241 **
242 ** By email: sofa@ukho.gov.uk
243 ** By post: IAU SOFA Center
244 ** HM Nautical Almanac Office
245 ** UK Hydrographic Office
246 ** Admiralty Way, Taunton
247 ** Somerset, TA1 2DN
248 ** United Kingdom
249 **
250 **--------------------------------------------------------------------*/
double phi
Definition: sofam.h:35
double xpl
Definition: sofam.h:36
double dl
Definition: sofam.h:50
double refa
Definition: sofam.h:42
double diurab
Definition: sofam.h:40
double along
Definition: sofam.h:34
double cphi
Definition: sofam.h:39
double sphi
Definition: sofam.h:38
double pmt
Definition: sofam.h:27
double bm1
Definition: sofam.h:32
Definition: sofam.h:26
double em
Definition: sofam.h:30
double ypl
Definition: sofam.h:37
double refb
Definition: sofam.h:43
double eral
Definition: sofam.h:41
double bm
Definition: sofam.h:49
Definition: sofam.h:48