98enum class GravityModel :
int {
110inline std::ostream &
operator<<(std::ostream &os,
const State &s) {
111 os <<
"SGP4 TEME (pos_km=(" << s.pos_km[0] <<
", " << s.pos_km[1] <<
", " << s.pos_km[2]
112 <<
"), vel_kms=(" << s.vel_kms[0] <<
", " << s.vel_kms[1] <<
", " << s.vel_kms[2] <<
"))";
128 explicit Propagator(
const tle::Tle &tle, GravityModel model = GravityModel::Wgs72) {
129 check_status(siderust_sgp4_new(tle.
raw(),
static_cast<int>(model), &handle_),
133 Propagator(Propagator &&other) noexcept : handle_(std::exchange(other.handle_,
nullptr)) {}
134 Propagator &operator=(Propagator &&other)
noexcept {
135 if (
this != &other) {
136 siderust_sgp4_free(handle_);
137 handle_ = std::exchange(other.handle_,
nullptr);
142 Propagator(
const Propagator &) =
delete;
143 Propagator &operator=(
const Propagator &) =
delete;
145 ~Propagator() { siderust_sgp4_free(handle_); }
148 double epoch_jd_utc()
const {
150 check_status(siderust_sgp4_epoch_jd_utc(handle_, &jd),
"sgp4::Propagator::epoch_jd_utc");
155 int gravity_model()
const {
157 check_status(siderust_sgp4_gravity_model(handle_, &m),
"sgp4::Propagator::gravity_model");
165 State propagate_at(
double jd_utc)
const {
167 check_status(siderust_sgp4_propagate_at(handle_, jd_utc, s.pos_km, s.vel_kms),
168 "sgp4::Propagator::propagate_at");
173 SiderustSgp4 *handle_ =
nullptr;