🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
JplDe.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/RunTime.hpp"
25#include <stdint.h> // for uint32_t
26#include <cstdio> // for FILE
27#include <mutex> // for std::mutex
28
29AST_NAMESPACE_BEGIN
30
31
40class AST_CORE_API JplDe
41{
42public:
44 {
45 eNotAvailable = -1,
46 eMercury = 0,
47 eVenus = 1,
48 eEarth = 2,
49 eMars = 3,
50 eJupiter = 4,
51 eSaturn = 5,
52 eUranus = 6,
53 eNeptune = 7,
54 ePluto = 8,
55 eMoon = 9,
56 eSun = 10,
57 eSSBarycenter = 11,
58 eEMBarycenter = 12,
59 };
60
61 JplDe();
62 ~JplDe();
63
67 errc_t open(const char* filepath);
68
69
70 errc_t openDefault();
71
74 bool isOpen() const;
75
76
78 void close();
79
80
89 errc_t getPosVelICRF(
90 const TimePoint& time,
91 EDataCode target,
92 EDataCode referenceBody,
93 Vector3d& pos,
94 Vector3d& vel
95 );
96
97 errc_t getPosVelICRF(
98 const TimePoint& time,
99 EDataCode target,
100 EDataCode referenceBody,
101 Vector3d& pos,
102 Vector3d* vel
103 );
104
105
113 errc_t getPosICRF(
114 const TimePoint& time,
115 EDataCode target,
116 EDataCode referenceBody,
117 Vector3d& pos
118 );
119
120
126 errc_t getNutation(
127 const TimePoint& time,
128 double& nutLong,
129 double& nutObl
130 );
131
132
139 errc_t getLibration(
140 const TimePoint& time,
141 Vector3d& ang,
142 Vector3d& angRate
143 );
144
150 errc_t getLibration(
151 const TimePoint& time,
152 Vector3d& ang
153 );
154
160 errc_t getLibration(
161 const TimePoint& time,
162 Euler& ang
163 );
164
167 uint32_t getEphemVersion() const{ return m_EphemVerion; }
168
169
173 errc_t getInterval(TimeInterval& interval) const;
174
175private:
176 errc_t readDataBlock(size_t idx);
177 errc_t getStateTDB(const JulianDate& jdTDB, int dataid, double pos[], double vel[]);
178 errc_t getStateTDB(const JulianDate& jdTDB, int datalist[11], double statelist[11][6]);
179
180 errc_t getState(const TimePoint& time, int dataid, double pos[], double vel[]);
181 errc_t getState(const TimePoint& time, int datalist[11], double statelist[11][6]);
182protected:
183 bool m_IsSameEndian; // 二进制文件与系统大小端是否一致
184 uint32_t m_EphemVerion{ 0 }; // De星历版本
185 uint32_t m_NumConstants{}; // 文件的常量个数
186 uint32_t m_NumDataBlock{0}; // 星历总的数据块个数
187 uint32_t m_NumCoeff{}; // 星历每个数据块的系数数量
188 uint32_t m_ipt[15][3]{}; // 数据指针[数据起始位置;每个坐标分量的数据量;子块个数:如4代表了32天要分为四块,每个子块包含了8天的数据]
189 double m_EphemStart{0}; // 星历起始时间(JED)
190 double m_EphemEnd{0}; // 星历结束时间(JED)
191 double m_EphemStep{0}; // 星历每个数据块的天数
192 double m_AU{}; // 光速 km
193 double m_EMMassRatio{}; // 地球月球质量比
194 FILE* m_DeFile{ NULL }; // De二进制文件
195 double** m_DataBlocks{NULL}; // 星历数据块的内存缓存
196 std::mutex m_DataBlockMutex; // 数据块缓存互斥锁
197};
198
199
200
203AST_NAMESPACE_END
欧拉角
定义 Euler.hpp:31
JPL DE文件接口类
定义 JplDe.hpp:41
EDataCode
定义 JplDe.hpp:44
uint32_t getEphemVersion() const
获取JPL DE文件的星历版本
定义 JplDe.hpp:167
儒略日
定义 JulianDate.hpp:82
时间区间
定义 TimeInterval.hpp:60
绝对时间点
定义 TimePoint.hpp:106