🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
SOFA.hpp
浏览该文件的文档.
1
21
22#pragma once
23
24#include "AstGlobal.h"
25#include "AstCore/TimePoint.hpp"
26
27AST_NAMESPACE_BEGIN
28
29
30//==============================================================================
31// SOFA (Standards of Fundamental Astronomy) 许可证声明
32//==============================================================================
33/*
34 * 重要声明:本文件中的函数基于国际天文联合会(IAU)的SOFA软件库实现。
35 *
36 * 根据SOFA软件许可证的要求,特此声明:
37 *
38 * 1. 本模块的代码使用了从SOFA软件库(版本2023-10-11)获得的算法和计算例程。
39 * 具体对应的SOFA函数请参考函数注释
40 *
41 * 2. SOFA软件由国际天文联合会(IAU) SOFA Board所有。
42 * SOFA软件许可证请参考:https://www.iausofa.org/terms-and-conditions
43 *
44 * 3. 根据SOFA许可证第3(c)条要求,本衍生作品的函数名不使用"iau"或"sofa"前缀。
45 * 本模块使用"a"前缀表示"astronomy"天文计算。
46 *
47 * 4. 根据SOFA许可证第3(a)条要求,声明本软件:
48 * (i) 使用了从SOFA软件派生的计算例程;
49 * (ii) 不是由SOFA提供或认可的软件。
50 *
51 * 5. 本衍生作品与原始SOFA软件的主要区别:
52 * - 函数接口针对ast项目的TimePoint等自定义类型进行了适配
53 * - 函数命名遵循ast项目的命名规范
54 * - 部分实现细节根据项目需求进行了优化和调整
55 * - 不保证与原始SOFA库在边界情况和精度上完全一致
56 *
57 * 6. 根据SOFA许可证第3(e)条要求,必须在SOFA软件衍生作品源代码分发中完整保留SOFA软件的版权声明
58 * SOFA软件的版权声明请参阅本文件底部。
59 *
60 */
61
62
63
70AST_CORE_CAPI void aPrecession_IAU1976(double t, double& zeta, double& z, double& theta);
71
72
73
78AST_CORE_CAPI double aMeanObliquity_IAU1980(double t);
79
80
81
82
89AST_CORE_CAPI void aNutation_IERS1996(double t, double &dpsi, double &deps, double* eqecorr);
90AST_CORE_CAPI void aNutation_IERS1996_Cache(double t, double &dpsi, double &deps, double* eqecorr);
91
97A_ALWAYS_INLINE void aNutation_IAU1980(double t, double &dpsi, double &deps)
98{
99 aNutation_IERS1996(t, dpsi, deps, nullptr);
100}
101A_ALWAYS_INLINE void aNutation_IAU1980_Cache(double t, double &dpsi, double &deps)
102{
103 aNutation_IERS1996_Cache(t, dpsi, deps, nullptr);
104}
105
106
107
108A_ALWAYS_INLINE void aPrecession_IAU1976(const TimePoint& tp, double& zeta, double& z, double& theta){
113 aPrecession_IAU1976(tp.julianCenturyFromJ2000TT(), zeta, z, theta);
114}
115
116
117A_ALWAYS_INLINE double aMeanObliquity_IAU1980(const TimePoint& tp){
118 return aMeanObliquity_IAU1980(tp.julianCenturyFromJ2000TT());
119}
120
121
122typedef errc_t (*NutationFunc)(const TimePoint& tp, double &dpsi, double &deps);
123
124A_ALWAYS_INLINE void aNutation_IAU1980(const TimePoint& tp, double& dpsi, double& deps)
125{
126 return aNutation_IAU1980(tp.julianCenturyFromJ2000TT(), dpsi, deps);
127}
128
133AST_CORE_CAPI NutationFunc aNutation;
134
135
136
141inline void aNutationFuncSet(NutationFunc func){
142 aNutation = func;
143}
144
145enum class ENutationMethod
146{
147 eIAU1980 = 0,
148 eJplDe = 1,
149 eUser = 2, // 用户自定义实现
150};
151
156AST_CORE_CAPI errc_t aNutationMethodSet(ENutationMethod method);
157
158
162AST_CORE_CAPI ENutationMethod aNutationMethodGet();
163
164
169AST_CORE_CAPI double aGMST_IAU1982(const TimePoint& tp);
170
171
176AST_CORE_CAPI double aGMST_UT1_IAU1982(const JulianDate& jdUT1);
177
178
183AST_CORE_CAPI double aGAST_IAU1994(const TimePoint& tp);
184
185
193AST_CORE_CAPI double aEquationOfEquinoxes_IAU1994(double t);
194
195A_ALWAYS_INLINE double aEquationOfEquinoxes_IAU1994(const TimePoint& tp)
196{
199}
200
201
206AST_CORE_CAPI double aEarthRotationAngle_IAU2000(const TimePoint& tp);
207
208
213AST_CORE_CAPI double aEarthRotationAngleUT1_IAU2000(const JulianDate& jdUT1);
214
215
216AST_NAMESPACE_END
217
218
219/* ----------------------------------------------------------------------------------
220 * 根据SOFA许可证第3(e)条要求,必须在SOFA软件衍生作品源代码分发中完整保留SOFA软件的版权声明
221 * 下面是SOFA软件的版权声明
222 * --------------------------------------------------------------------------------- */
223
224/*----------------------------------------------------------------------
225**
226** Copyright (C) 2023
227** Standards of Fundamental Astronomy Board
228** of the International Astronomical Union.
229**
230** =====================
231** SOFA Software License
232** =====================
233**
234** NOTICE TO USER:
235**
236** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
237** CONDITIONS WHICH APPLY TO ITS USE.
238**
239** 1. The Software is owned by the IAU SOFA Board ("SOFA").
240**
241** 2. Permission is granted to anyone to use the SOFA software for any
242** purpose, including commercial applications, free of charge and
243** without payment of royalties, subject to the conditions and
244** restrictions listed below.
245**
246** 3. You (the user) may copy and distribute SOFA source code to others,
247** and use and adapt its code and algorithms in your own software,
248** on a world-wide, royalty-free basis. That portion of your
249** distribution that does not consist of intact and unchanged copies
250** of SOFA source code files is a "derived work" that must comply
251** with the following requirements:
252**
253** a) Your work shall be marked or carry a statement that it
254** (i) uses routines and computations derived by you from
255** software provided by SOFA under license to you; and
256** (ii) does not itself constitute software provided by and/or
257** endorsed by SOFA.
258**
259** b) The source code of your derived work must contain descriptions
260** of how the derived work is based upon, contains and/or differs
261** from the original SOFA software.
262**
263** c) The names of all routines in your derived work shall not
264** include the prefix "iau" or "sofa" or trivial modifications
265** thereof such as changes of case.
266**
267** d) The origin of the SOFA components of your derived work must
268** not be misrepresented; you must not claim that you wrote the
269** original software, nor file a patent application for SOFA
270** software or algorithms embedded in the SOFA software.
271**
272** e) These requirements must be reproduced intact in any source
273** distribution and shall apply to anyone to whom you have
274** granted a further right to modify the source code of your
275** derived work.
276**
277** Note that, as originally distributed, the SOFA software is
278** intended to be a definitive implementation of the IAU standards,
279** and consequently third-party modifications are discouraged. All
280** variations, no matter how minor, must be explicitly marked as
281** such, as explained above.
282**
283** 4. You shall not cause the SOFA software to be brought into
284** disrepute, either by misuse, or use for inappropriate tasks, or
285** by inappropriate modification.
286**
287** 5. The SOFA software is provided "as is" and SOFA makes no warranty
288** as to its use or performance. SOFA does not and cannot warrant
289** the performance or results which the user may obtain by using the
290** SOFA software. SOFA makes no warranties, express or implied, as
291** to non-infringement of third party rights, merchantability, or
292** fitness for any particular purpose. In no event will SOFA be
293** liable to the user for any consequential, incidental, or special
294** damages, including any lost profits or lost savings, even if a
295** SOFA representative has been advised of such damages, or for any
296** claim by any third party.
297**
298** 6. The provision of any version of the SOFA software under the terms
299** and conditions specified herein does not imply that future
300** versions will also be made available under the same terms and
301** conditions.
302*
303** In any published work or commercial product which uses the SOFA
304** software directly, acknowledgement (see www.iausofa.org) is
305** appreciated.
306**
307** Correspondence concerning SOFA software should be addressed as
308** follows:
309**
310** By email: sofa@ukho.gov.uk
311** By post: IAU SOFA Center
312** HM Nautical Almanac Office
313** UK Hydrographic Office
314** Admiralty Way, Taunton
315** Somerset, TA1 2DN
316** United Kingdom
317**
318**--------------------------------------------------------------------*/
319
绝对时间点
定义 TimePoint.hpp:106
double julianCenturyFromJ2000TT() const
计算时间点与 J2000 epoch 的时间差(儒略世纪)
定义 TimePoint.hpp:171
void aNutationFuncSet(NutationFunc func)
设置章动角计算函数指针
定义 SOFA.hpp:141
double aGMST_UT1_IAU1982(const JulianDate &jdUT1)
计算给定UT1时间的格林尼治平恒星时(GMST),依据IAU1982规范
定义 SOFA.cpp:469
A_ALWAYS_INLINE void aNutation_IAU1980(double t, double &dpsi, double &deps)
计算给定时间差的章动角,依据IAU1980规范
定义 SOFA.hpp:97
double aMeanObliquity_IAU1980(double t)
计算给定时间差的平均黄赤交角,依据IAU1980规范
定义 SOFA.cpp:110
errc_t aNutationMethodSet(ENutationMethod method)
设置章动角计算函数
定义 SOFA.cpp:432
ENutationMethod aNutationMethodGet()
获取当前章动角计算函数
定义 SOFA.cpp:448
NutationFunc aNutation
章动角计算函数指针
定义 SOFA.cpp:429
double aEquationOfEquinoxes_IAU1994(double t)
计算给定时间点的赤经章动,依据IAU1994规范
定义 SOFA.cpp:514
double aGAST_IAU1994(const TimePoint &tp)
计算给定时间点的格林尼治视恒星时(GAST),依据IAU1982规范
定义 SOFA.cpp:498
double aGMST_IAU1982(const TimePoint &tp)
计算给定时间点的格林尼治平恒星时(GMST),依据IAU1982规范
定义 SOFA.cpp:462
void aNutation_IERS1996(double t, double &dpsi, double &deps, double *eqecorr)
计算给定时间差的章动角,依据IERS1996规范
定义 SOFA.cpp:133
void aPrecession_IAU1976(double t, double &zeta, double &z, double &theta)
计算给定时间差的岁差角,依据IAU1976规范
定义 SOFA.cpp:83