Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.5.0] - 2026-05-18

### Removed

- Dropped the C++ satellite/dynamics adapter surface, including
`include/siderust/dynamics.hpp`, the vendored `siderust-ffi` dynamics
exports, and the associated C++ dynamics tests (`tests/test_dynamics.cpp`).
Specifying the `satellite` CMake feature now produces a `FATAL_ERROR`.
- Removed backward-compatible `(start, end)` two-argument overloads from
`altitude.hpp`, `azimuth.hpp`, `lunar_phase.hpp`, `subject.hpp`, and
`target.hpp`. Callers must construct a `Period(start, end)` explicitly and
pass it to the `Period`-taking overload.
- Removed `#include <siderust/dynamics.hpp>` from the umbrella
`include/siderust/siderust.hpp` header.

### Changed

- Submodule `siderust` advanced to v0.8.0 (from v0.7.0): brings qtty 0.8,
tempoch 0.6, `siderust::JulianDate` / `ModifiedJulianDate` crate-root
re-exports, and removal of the FFI dynamics layer.
- Submodule `tempoch-cpp` advanced to v0.5.0 (from v0.4.x).

## [0.4.0] - 2026-05-15

### Added

- `include/siderust/constops.hpp` and generated `include/siderust/constops.h` with JSON-oriented wrappers for the constops FFI surface, including route constants and ground-asset ID helpers.
- `include/siderust/dynamics.hpp` with RAII wrappers for the dynamics FFI, including `DynamicsContext`, `OrbitState`, and two-body propagation support.

### Changed

Expand Down
15 changes: 5 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15)
project(siderust_cpp VERSION 0.4.0 LANGUAGES CXX)
project(siderust_cpp VERSION 0.5.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -26,10 +26,11 @@ elseif(NOT "${SIDERUST_FFI_FEATURES}" STREQUAL "")
set(_SIDERUST_FEATURES_ARGS --features ${SIDERUST_FFI_FEATURES})
endif()

# Detect whether the satellite feature is enabled so C++ dynamics.hpp is armed.
set(_SIDERUST_SATELLITE OFF)
if(SIDERUST_FFI_FEATURES MATCHES "(^|,)satellite(,|$)")
set(_SIDERUST_SATELLITE ON)
message(FATAL_ERROR
"The satellite feature and C++ dynamics adapter have been removed from siderust-cpp. "
"Remove 'satellite' from SIDERUST_FFI_FEATURES."
)
endif()

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -104,9 +105,6 @@ target_link_libraries(siderust_cpp INTERFACE
$<INSTALL_INTERFACE:tempoch::tempoch_cpp>
$<INSTALL_INTERFACE:qtty::qtty_cpp>
)
if(_SIDERUST_SATELLITE)
target_compile_definitions(siderust_cpp INTERFACE SIDERUST_SATELLITE=1)
endif()
add_dependencies(siderust_cpp build_siderust_ffi)

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -213,9 +211,6 @@ set(TEST_SOURCES
tests/test_context.cpp
tests/test_twilight.cpp
)
if(_SIDERUST_SATELLITE)
list(APPEND TEST_SOURCES tests/test_dynamics.cpp)
endif()

add_executable(test_siderust ${TEST_SOURCES})
target_link_libraries(test_siderust PRIVATE siderust_cpp GTest::gtest)
Expand Down
3 changes: 1 addition & 2 deletions examples/05_target_tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ void section_target_snapshots(const TTJD &jd, const TTJD &jd_next) {
/// Computes: RA' = RA + μα* · Δt / cos(dec), Dec' = Dec + μδ · Δt
/// where Δt is in Julian years since the reference epoch.
inline spherical::direction::ICRS apply_proper_motion(const spherical::direction::ICRS &pos,
const ProperMotion &pm,
const TTJD &epoch,
const ProperMotion &pm, const TTJD &epoch,
const TTJD &target_epoch) {
constexpr double JULIAN_YEAR = 365.25; // days
double dt_years = (target_epoch.value() - epoch.value()) / JULIAN_YEAR;
Expand Down
3 changes: 1 addition & 2 deletions examples/06_night_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ static void print_events_for_type(const Geodetic &site, const TTMjdPeriod &week,
std::cout << " summary: down=" << downs << " raise=" << raises << std::endl;
}

static void print_periods_for_type(const Geodetic &site, const TTMjdPeriod &week,
const char *name,
static void print_periods_for_type(const Geodetic &site, const TTMjdPeriod &week, const char *name,
qtty::Degree threshold) {
auto periods = sun::below_threshold(site, week, threshold);
std::cout << std::left << std::setw(18) << name << " night periods (Sun < " << std::fixed
Expand Down
6 changes: 4 additions & 2 deletions examples/10_time_periods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ int main() {
CivilPeriod civil_window(to_utc_civil(jd_window.start()), to_utc_civil(jd_window.end()));

std::cout << "Periods over the same half-day window:\n";
std::cout << " JD(TT) " << jd_window << " duration=" << jd_window.duration<qtty::Hour>() << "\n";
std::cout << " MJD(TT) " << mjd_window << " duration=" << mjd_window.duration<qtty::Hour>() << "\n";
std::cout << " JD(TT) " << jd_window << " duration=" << jd_window.duration<qtty::Hour>()
<< "\n";
std::cout << " MJD(TT) " << mjd_window << " duration=" << mjd_window.duration<qtty::Hour>()
<< "\n";
std::cout << " Civil " << civil_window << " duration=" << civil_window.duration<qtty::Hour>()
<< "\n";

Expand Down
155 changes: 2 additions & 153 deletions include/siderust/altitude.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ struct CulminationEvent {
CulminationKind kind;

static CulminationEvent from_c(const siderust_culmination_event_t &c) {
return {ModifiedJulianDate(c.mjd), qtty::Degree(c.altitude_deg), static_cast<CulminationKind>(c.kind)};
return {ModifiedJulianDate(c.mjd), qtty::Degree(c.altitude_deg),
static_cast<CulminationKind>(c.kind)};
}
};

Expand Down Expand Up @@ -148,14 +149,6 @@ inline std::vector<Period> above_threshold(const Geodetic &obs, const Period &wi
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> above_threshold(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold, const SearchOptions &opts = {}) {
return above_threshold(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find periods when the Sun is below a threshold altitude.
*/
Expand All @@ -170,14 +163,6 @@ inline std::vector<Period> below_threshold(const Geodetic &obs, const Period &wi
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> below_threshold(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold, const SearchOptions &opts = {}) {
return below_threshold(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find threshold-crossing events for the Sun.
*/
Expand All @@ -192,15 +177,6 @@ inline std::vector<CrossingEvent> crossings(const Geodetic &obs, const Period &w
return detail::crossings_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CrossingEvent> crossings(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold,
const SearchOptions &opts = {}) {
return crossings(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find culmination events for the Sun.
*/
Expand All @@ -214,14 +190,6 @@ inline std::vector<CulminationEvent> culminations(const Geodetic &obs, const Per
return detail::culminations_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CulminationEvent> culminations(const Geodetic &obs, const ModifiedJulianDate &start,
const ModifiedJulianDate &end, const SearchOptions &opts = {}) {
return culminations(obs, Period(start, end), opts);
}

/**
* @brief Find periods when the Sun's altitude is within [min, max].
*/
Expand All @@ -237,21 +205,6 @@ inline std::vector<Period> altitude_periods(const Geodetic &obs, const Period &w
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> altitude_periods(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree min_alt, qtty::Degree max_alt) {
siderust_altitude_query_t q = {obs.to_c(), start.value(), end.value(), min_alt.value(),
max_alt.value()};
tempoch_period_mjd_t *ptr = nullptr;
uintptr_t count = 0;
check_status(
siderust_altitude_periods(detail::make_body_subject(SIDERUST_BODY_SUN), q, &ptr, &count),
"sun::altitude_periods");
return detail::periods_from_c(ptr, count);
}

} // namespace sun

// ============================================================================
Expand Down Expand Up @@ -285,14 +238,6 @@ inline std::vector<Period> above_threshold(const Geodetic &obs, const Period &wi
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> above_threshold(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold, const SearchOptions &opts = {}) {
return above_threshold(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find periods when the Moon is below a threshold altitude.
*/
Expand All @@ -307,14 +252,6 @@ inline std::vector<Period> below_threshold(const Geodetic &obs, const Period &wi
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> below_threshold(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold, const SearchOptions &opts = {}) {
return below_threshold(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find threshold-crossing events for the Moon.
*/
Expand All @@ -329,15 +266,6 @@ inline std::vector<CrossingEvent> crossings(const Geodetic &obs, const Period &w
return detail::crossings_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CrossingEvent> crossings(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree threshold,
const SearchOptions &opts = {}) {
return crossings(obs, Period(start, end), threshold, opts);
}

/**
* @brief Find culmination events for the Moon.
*/
Expand All @@ -351,14 +279,6 @@ inline std::vector<CulminationEvent> culminations(const Geodetic &obs, const Per
return detail::culminations_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CulminationEvent> culminations(const Geodetic &obs, const ModifiedJulianDate &start,
const ModifiedJulianDate &end, const SearchOptions &opts = {}) {
return culminations(obs, Period(start, end), opts);
}

/**
* @brief Find periods when the Moon's altitude is within [min, max].
*/
Expand All @@ -374,21 +294,6 @@ inline std::vector<Period> altitude_periods(const Geodetic &obs, const Period &w
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> altitude_periods(const Geodetic &obs, const ModifiedJulianDate &start, const ModifiedJulianDate &end,
qtty::Degree min_alt, qtty::Degree max_alt) {
siderust_altitude_query_t q = {obs.to_c(), start.value(), end.value(), min_alt.value(),
max_alt.value()};
tempoch_period_mjd_t *ptr = nullptr;
uintptr_t count = 0;
check_status(
siderust_altitude_periods(detail::make_body_subject(SIDERUST_BODY_MOON), q, &ptr, &count),
"moon::altitude_periods");
return detail::periods_from_c(ptr, count);
}

} // namespace moon

// ============================================================================
Expand Down Expand Up @@ -422,15 +327,6 @@ inline std::vector<Period> above_threshold(const Star &s, const Geodetic &obs, c
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> above_threshold(const Star &s, const Geodetic &obs, const ModifiedJulianDate &start,
const ModifiedJulianDate &end, qtty::Degree threshold,
const SearchOptions &opts = {}) {
return above_threshold(s, obs, Period(start, end), threshold, opts);
}

/**
* @brief Find periods when a star is below a threshold altitude.
*/
Expand All @@ -445,15 +341,6 @@ inline std::vector<Period> below_threshold(const Star &s, const Geodetic &obs, c
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<Period> below_threshold(const Star &s, const Geodetic &obs, const ModifiedJulianDate &start,
const ModifiedJulianDate &end, qtty::Degree threshold,
const SearchOptions &opts = {}) {
return below_threshold(s, obs, Period(start, end), threshold, opts);
}

/**
* @brief Find threshold-crossing events for a star.
*/
Expand All @@ -468,15 +355,6 @@ inline std::vector<CrossingEvent> crossings(const Star &s, const Geodetic &obs,
return detail::crossings_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CrossingEvent> crossings(const Star &s, const Geodetic &obs, const ModifiedJulianDate &start,
const ModifiedJulianDate &end, qtty::Degree threshold,
const SearchOptions &opts = {}) {
return crossings(s, obs, Period(start, end), threshold, opts);
}

/**
* @brief Find culmination events for a star.
*/
Expand All @@ -491,15 +369,6 @@ inline std::vector<CulminationEvent> culminations(const Star &s, const Geodetic
return detail::culminations_from_c(ptr, count);
}

/**
* @brief Backward-compatible [start, end] overload.
*/
inline std::vector<CulminationEvent> culminations(const Star &s, const Geodetic &obs,
const ModifiedJulianDate &start, const ModifiedJulianDate &end,
const SearchOptions &opts = {}) {
return culminations(s, obs, Period(start, end), opts);
}

} // namespace star_altitude

// ============================================================================
Expand Down Expand Up @@ -543,16 +412,6 @@ inline std::vector<Period> above_threshold(const spherical::direction::ICRS &dir
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible RA/Dec + [start, end] overload.
*/
inline std::vector<Period> above_threshold(qtty::Degree ra, qtty::Degree dec, const Geodetic &obs,
const ModifiedJulianDate &start, const ModifiedJulianDate &end, qtty::Degree threshold,
const SearchOptions &opts = {}) {
return above_threshold(spherical::direction::ICRS(ra, dec), obs, Period(start, end), threshold,
opts);
}

/**
* @brief Find periods when a fixed ICRS direction is below a threshold.
*/
Expand All @@ -568,16 +427,6 @@ inline std::vector<Period> below_threshold(const spherical::direction::ICRS &dir
return detail::periods_from_c(ptr, count);
}

/**
* @brief Backward-compatible RA/Dec + [start, end] overload.
*/
inline std::vector<Period> below_threshold(qtty::Degree ra, qtty::Degree dec, const Geodetic &obs,
const ModifiedJulianDate &start, const ModifiedJulianDate &end, qtty::Degree threshold,
const SearchOptions &opts = {}) {
return below_threshold(spherical::direction::ICRS(ra, dec), obs, Period(start, end), threshold,
opts);
}

} // namespace icrs_altitude

} // namespace siderust
Loading
Loading