🛰️航天仿真算法库 SpaceAST 0.3.1
载入中...
搜索中...
未找到
ast::JplDe类 参考

#include <JplDe.hpp>

Public 类型

enum  EDataCode {
  eNotAvailable = -1 , eMercury = 0 , eVenus = 1 , eEarth = 2 ,
  eMars = 3 , eJupiter = 4 , eSaturn = 5 , eUranus = 6 ,
  eNeptune = 7 , ePluto = 8 , eMoon = 9 , eSun = 10 ,
  eSSBarycenter = 11 , eEMBarycenter = 12
}
 
using ConstantList = std::vector<std::pair<std::string, double>>
 
using ConstantMap = OrderedMap<std::string, double>
 

Public 成员函数

 JplDe (const JplDe &)=delete
 
JplDe & operator= (const JplDe &)=delete
 
errc_t open (const char *filepath)
 
errc_t openDefault ()
 
bool isOpen () const
 
void close ()
 
errc_t getPosVelICRF (const TimePoint &time, EDataCode target, EDataCode referenceBody, Vector3d &pos, Vector3d &vel)
 
errc_t getPosVelICRF (const TimePoint &time, EDataCode target, EDataCode referenceBody, Vector3d &pos, Vector3d *vel)
 
errc_t getPosICRF (const TimePoint &time, EDataCode target, EDataCode referenceBody, Vector3d &pos)
 
errc_t getNutation (const TimePoint &time, double &nutLong, double &nutObl)
 
errc_t getLibration (const TimePoint &time, Euler &ang, Euler &angRate)
 
errc_t getLibration (const TimePoint &time, Euler &ang)
 
uint32_t getEphemVersion () const
 
uint32_t getNumConstants () const
 
const ConstantList & getConstants () const
 
errc_t getConstant (size_t index, double &value, std::string *name=nullptr) const
 
errc_t getConstant (const std::string &name, double &value) const
 
double getConstant (const std::string &name) const
 
double getAU () const
 
double getEarthMoonMassRatio () const
 
double getBodyGM (EDataCode bodyCode) const
 
errc_t getBodyGM (EDataCode bodyCode, double &value) const
 
errc_t getInterval (TimeInterval &interval) const
 

Protected 属性

bool isSameEndian_
 
uint32_t ephemVersion_ { 0 }
 
uint32_t numConstants_ {}
 
uint32_t numDataBlock_ {0}
 
uint32_t numCoeff_ {}
 
uint32_t ipt_ [15][3] {}
 
double ephemStart_ {0}
 
double ephemEnd_ {0}
 
double ephemStep_ {0}
 
double au_ {}
 
double emMassRatio_ {}
 
FILE * deFile_ { NULL }
 
double ** dataBlocks_ {NULL}
 
ConstantMap constants_ {}
 
std::mutex mutex_ {}
 

详细描述

JPL DE文件接口类

成员枚举类型说明

◆ EDataCode

枚举值
eNotAvailable 

不可用

eMercury 

水星

eVenus 

金星

eEarth 

地球

eMars 

火星

eJupiter 

木星

eSaturn 

土星

eUranus 

天王星

eNeptune 

海王星

ePluto 

冥王星

eMoon 

月球

eSun 

太阳

eSSBarycenter 

太阳系质心

eEMBarycenter 

地月系质心

成员函数说明

◆ getAU()

double ast::JplDe::getAU ( ) const
inline

获取JPL DE文件中的天文单位长度

返回值
-天文单位长度(米)

◆ getBodyGM()

double ast::JplDe::getBodyGM ( EDataCode bodyCode) const

获取JPL DE文件中指定天体的GM值

文件内 GM 以 AU³/day² 存储,本函数换算为 SI 单位 m³/s² 返回 (与 getAU() 返回米、getPosVelICRF() 返回米/米每秒 保持一致)。 地球/月球无独立 GM,由地月质心 GM(GMB) 与地球月球质量比拆分。

参数
bodyCode- 天体代码(eEarth / eMoon 会自动拆分地月质心)
返回值
-天体GM值[m³/s²];未找到返回 NaN

◆ getConstant() [1/3]

double ast::JplDe::getConstant ( const std::string & name) const

获取JPL DE文件中指定名称的常量数值

按名返回常量值(名称去掉尾部空格后再比较,O(1) 哈希查找;首次调用时懒加载)

参数
name- 常量名称(如 "GM1"、"AU"、"EMRAT" 等)
返回值
-常量值;未找到返回 NaN

◆ getConstant() [2/3]

errc_t ast::JplDe::getConstant ( const std::string & name,
double & value ) const

获取JPL DE文件中指定名称的常量数值

按名返回常量值(名称去掉尾部空格后再比较,O(1) 哈希查找;首次调用时懒加载)

参数
name- 常量名称(如 "GM1"、"AU"、"EMRAT" 等)
value- 输出:常量值
返回值
-错误码;未找到返回 JPL_EPH_QUANTITY_NOT_IN_EPHEMERIS

◆ getConstant() [3/3]

errc_t ast::JplDe::getConstant ( size_t index,
double & value,
std::string * name = nullptr ) const

获取JPL DE文件中指定索引的常量(名称与数值)

常量名取自文件头 constant_names 表(6字符),数值取自常量记录区

参数
index- 常量索引 [0, numConstants_)
value- 输出:常量值
name- 输出:常量名称(可为 nullptr)
返回值
-错误码

◆ getEarthMoonMassRatio()

double ast::JplDe::getEarthMoonMassRatio ( ) const
inline

获取JPL DE文件中的地球月球质量比

返回值
-地球月球质量比

◆ getEphemVersion()

uint32_t ast::JplDe::getEphemVersion ( ) const
inline

获取JPL DE文件的星历版本

返回值
-星历版本

◆ getInterval()

errc_t ast::JplDe::getInterval ( TimeInterval & interval) const

获取JPL DE星历数据的时间间隔

参数
interval- 时间间隔
返回值
-错误码

◆ getLibration() [1/2]

errc_t ast::JplDe::getLibration ( const TimePoint & time,
Euler & ang )

获取对应时间点的月球天平动相关角度(Euler)

参数
time- 时间点
ang- 从ICRF到月球惯性主轴坐标系的转角(rad)
  • [omega,i,u],[进动角,章动角,自转角],按照313顺序旋转
返回值
-错误码

◆ getLibration() [2/2]

errc_t ast::JplDe::getLibration ( const TimePoint & time,
Euler & ang,
Euler & angRate )

获取对应时间点的月球天平动相关角度

参数
time- 时间点
ang- 从ICRF到月球惯性主轴坐标系的转角(rad)
  • [omega,i,u],[进动角,章动角,自转角],按照313顺序旋转
angRate- 转动角速率[rad/s]
返回值
-错误码

◆ getNumConstants()

uint32_t ast::JplDe::getNumConstants ( ) const
inline

获取JPL DE文件中的常量个数

返回值
-常量个数

◆ getNutation()

errc_t ast::JplDe::getNutation ( const TimePoint & time,
double & nutLong,
double & nutObl )

获取对应时间点的章动角

参数
time- 时间点
nutLong- 黄经章动[rad]
nutObl- 倾角章动[rad]
返回值
-错误码

◆ getPosICRF()

errc_t ast::JplDe::getPosICRF ( const TimePoint & time,
EDataCode target,
EDataCode referenceBody,
Vector3d & pos )

获取对应时间点的目标天体在参考天体下的位置

位置向量的参考系是参考天体为中心的ICRF系

参数
time- 时间点
target- 目标天体
referenceBody-参考天体
pos- 位置向量[m]
返回值
-错误码

◆ getPosVelICRF()

errc_t ast::JplDe::getPosVelICRF ( const TimePoint & time,
EDataCode target,
EDataCode referenceBody,
Vector3d & pos,
Vector3d & vel )

获取对应时间点的目标天体在参考天体下的位置和速度

位置向量和速度向量的参考系是参考天体为中心的ICRF系

参数
time- 时间点
target- 目标天体
referenceBody-参考天体
pos- 位置向量[m]
vel- 速度向量[m/s]
返回值
-错误码

◆ isOpen()

bool ast::JplDe::isOpen ( ) const

检查JPL DE文件是否已打开

返回值
-是否已打开

◆ open()

errc_t ast::JplDe::open ( const char * filepath)

打开JPL DE文件

参数
filepath- JPL DE文件路径
返回值
-错误码

该类的文档由以下文件生成: