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

#include <SPKParser.hpp>

+ 类 ast::SPKParser 继承关系图:

Public 成员函数

 SPKParser (StringView filepath)
 
errc_t parse (StringView filepath)
 
errc_t parse ()
 
errc_t getPosVelNative (double et, int target, Vector3d &pos, Vector3d &vel) const
 
errc_t getPosNative (double et, int target, Vector3d &pos) const
 
const SPK_DescriptorfindSpkDescriptor (int target, double et) const
 
errc_t getStateNative (double et, int target, Vector3d &pos, Vector3d *vel) const
 
const std::vector< SPK_Descriptor > & getDescriptors () const
 
- Public 成员函数 继承自 ast::DAFParser
 DAFParser (StringView filepath)
 
errc_t parse ()
 
errc_t parse (StringView filepath)
 
bool isValidFile () const
 
size_t readRecord (int recordIndex, void *buffer, size_t size) const
 
size_t readFileRecord (void *buffer, size_t size) const
 
errc_t getFileRecord (Record &fileRecord) const
 
errc_t getSummaryRecords (std::vector< Record > &summaryRecords) const
 
errc_t getFileRecord (int &nd, int &ni, int &fward, int &bward, int &free) const
 
errc_t getComment (std::string &comment) const
 
errc_t getComment (std::vector< std::string > &comments) const
 
void printComment (std::FILE *fp=stdout) const
 
void open (StringView filepath)
 
- Public 成员函数 继承自 ast::BaseParser
 BaseParser (StringView filepath)
 
void open (StringView filepath)
 
bool isOpen () const
 
void close ()
 
void seek (std::streamoff pos, std::ios::seekdir dir)
 
std::streamoff tell ()
 
bool eof () const
 
size_t read (void *buffer, size_t size, size_t pos) const
 
StringView getLineWithNewline ()
 
StringView getLine ()
 
StringView getLineTrim ()
 
StringView getLineSkipHashComment ()
 
int getLineNumber ()
 
std::string getFilePath () const
 
void setBorrowedFile (FILE *file)
 
void setOwnedFile (FILE *file)
 
FILE * getFile () const
 

Protected 成员函数

errc_t getStateType2 (const SPK_Descriptor &desc, double et, int target, Vector3d &pos, Vector3d *vel) const
 
- Protected 成员函数 继承自 ast::DAFParser
errc_t runTest ()
 
errc_t readSummaryRecords (int fward, int bward, std::vector< Record > &summaryRecords) const
 
const DAF_FileRecordgetFileRecord () const
 

Protected 属性

std::vector< SPK_DescriptorspkDescriptors_
 
std::vector< double > buffer_
 
- Protected 属性 继承自 ast::DAFParser
Record fileRecord_
 
bool isValidFile_ =false
 
bool isSameEndian_ =false
 
- Protected 属性 继承自 ast::BaseParser
FILE * file_ {nullptr}
 
bool fileBorrowed_ {false}
 
std::vector< char > lineBuffer_
 

额外继承的成员函数

- Public 类型 继承自 ast::DAFParser
using Record = std::array<char, 1024>
 

详细描述

SPICE二进制SPK内核文件解析器(parser for SPICE SPK kernel file)

参见
cspice库里的文档 doc/html/req/spk.html

用于解析SPICE二进制SPK内核文件(.bsp),提供获取目标在指定时刻的原始位置和速度的功能。 “原始”意味着直接返回SPK文件中存储的相对于相应参考系的位置和速度,不进行任何额外的坐标转换。 使用前需通过 SpiceDAFParser::parse() 等方法打开并解析SPK文件

警告
该类型的单个实例暂不支持多线程并发访问
待办事项
处理不同类型的SPK数据,目前仅支持类型2

成员函数说明

◆ findSpkDescriptor()

const SPK_Descriptor * ast::SPKParser::findSpkDescriptor ( int target,
double et ) const

查找目标在指定时间的SPK段描述符

从SPK文件中查找给定目标在给定时间的SPK段描述符。 如果目标在给定时间没有对应的段,返回nullptr。

参数
target目标的NAIF ID代码
et相对于J2000 TDB的历元(秒)
返回
指向SPK段描述符的指针如果未找到)
注解
根据SPK星历规范,越后面的段优先级越高

◆ getPosNative()

errc_t ast::SPKParser::getPosNative ( double et,
int target,
Vector3d & pos ) const

获取目标在指定时刻的原始位置(相对于其星历参考系)

直接从SPK内核文件中读取数据,返回目标在给定时刻相对于该段定义的参考系的位置。 不执行任何坐标转换

参数
et相对于J2000 TDB的历元(秒)
target目标的NAIF ID代码
[out]pos位置向量 (x, y, z),单位米(m)
返回
错误码,成功返回0,失败返回非0值(如时间超出时间区间、目标不存在等)

◆ getPosVelNative()

errc_t ast::SPKParser::getPosVelNative ( double et,
int target,
Vector3d & pos,
Vector3d & vel ) const

获取目标在指定时刻的原始位置和速度(相对于其星历参考系)

直接从SPK内核文件中读取数据,返回目标在给定时刻相对于该段定义的参考系的位置和速度。 不执行任何坐标转换

参数
et相对于J2000 TDB的历元(秒)
target目标的NAIF ID代码(如399代表地球)
[out]pos位置向量 (x, y, z),单位米(m)
[out]vel速度向量 (vx, vy, vz),单位米/秒(m/s)
返回
错误码,成功返回0,失败返回非0值(如时间超出时间区间、目标不存在等)

◆ getStateNative()

errc_t ast::SPKParser::getStateNative ( double et,
int target,
Vector3d & pos,
Vector3d * vel ) const

获取目标在指定时刻的原始位置和速度(相对于其星历参考系)

直接从SPK内核文件中读取数据,返回目标在给定时刻相对于该段定义的参考系的位置和速度。 不执行任何坐标转换

参数
et相对于J2000 TDB的历元(秒)
target目标的NAIF ID代码
[out]pos位置向量 (x, y, z),单位米(m)
[out]vel速度向量 (vx, vy, vz),单位米/秒(m/s)
返回
错误码,成功返回0,失败返回非0值(如时间超出时间区间、目标不存在等)

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