77inline std::vector<Period<TT, MJD>>
periods_from_c(tempoch_period_mjd_t *ptr, uintptr_t count) {
78 std::vector<Period<TT, MJD>> result;
79 result.reserve(count);
80 for (uintptr_t i = 0; i < count; ++i) {
83 siderust_periods_free(ptr, count);
89 std::vector<CrossingEvent> result;
90 result.reserve(count);
91 for (uintptr_t i = 0; i < count; ++i) {
94 siderust_crossings_free(ptr, count);
100 std::vector<CulminationEvent> result;
101 result.reserve(count);
102 for (uintptr_t i = 0; i < count; ++i) {
105 siderust_culminations_free(ptr, count);
125 return qtty::Radian(out);
133 qtty::Degree threshold,
135 tempoch_period_mjd_t *ptr =
nullptr;
138 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
140 "sun::above_threshold");
149 qtty::Degree threshold,
151 tempoch_period_mjd_t *ptr =
nullptr;
154 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
156 "sun::below_threshold");
164 qtty::Degree threshold,
166 siderust_crossing_event_t *ptr =
nullptr;
169 window.c_inner(), threshold.value(), opts.to_c(), &ptr, &count),
177inline std::vector<CulminationEvent>
179 siderust_culmination_event_t *ptr =
nullptr;
182 window.c_inner(), opts.to_c(), &ptr, &count),
183 "sun::culminations");
192 qtty::Degree min_alt, qtty::Degree max_alt,
194 tempoch_period_mjd_t *ptr =
nullptr;
197 window.c_inner(), min_alt.value(), max_alt.value(),
198 opts.to_c(), &ptr, &count),
199 "sun::altitude_ranges");
218 "moon::altitude_at");
219 return qtty::Radian(out);
227 qtty::Degree threshold,
229 tempoch_period_mjd_t *ptr =
nullptr;
232 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
234 "moon::above_threshold");
243 qtty::Degree threshold,
245 tempoch_period_mjd_t *ptr =
nullptr;
248 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
250 "moon::below_threshold");
258 qtty::Degree threshold,
260 siderust_crossing_event_t *ptr =
nullptr;
263 window.c_inner(), threshold.value(), opts.to_c(), &ptr, &count),
271inline std::vector<CulminationEvent>
273 siderust_culmination_event_t *ptr =
nullptr;
276 window.c_inner(), opts.to_c(), &ptr, &count),
277 "moon::culminations");
286 qtty::Degree min_alt, qtty::Degree max_alt,
288 tempoch_period_mjd_t *ptr =
nullptr;
291 window.c_inner(), min_alt.value(), max_alt.value(),
292 opts.to_c(), &ptr, &count),
293 "moon::altitude_ranges");
303namespace star_altitude {
312 "star_altitude::altitude_at");
313 return qtty::Radian(out);
321 qtty::Degree threshold,
323 tempoch_period_mjd_t *ptr =
nullptr;
326 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
328 "star_altitude::above_threshold");
337 qtty::Degree threshold,
339 tempoch_period_mjd_t *ptr =
nullptr;
342 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
344 "star_altitude::below_threshold");
354 siderust_crossing_event_t *ptr =
nullptr;
357 window.c_inner(), threshold.value(), opts.to_c(), &ptr, &count),
358 "star_altitude::crossings");
368 siderust_culmination_event_t *ptr =
nullptr;
371 window.c_inner(), opts.to_c(), &ptr, &count),
372 "star_altitude::culminations");
382namespace icrs_altitude {
392 "icrs_altitude::altitude_at");
393 return qtty::Radian(out);
410 qtty::Degree threshold,
412 tempoch_period_mjd_t *ptr =
nullptr;
415 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
417 "icrs_altitude::above_threshold");
427 qtty::Degree threshold,
429 tempoch_period_mjd_t *ptr =
nullptr;
432 window.c_inner(), threshold.value(), opts.to_c(), &ptr,
434 "icrs_altitude::below_threshold");
444 qtty::Degree min_alt, qtty::Degree max_alt,
446 tempoch_period_mjd_t *ptr =
nullptr;
449 window.c_inner(), min_alt.value(), max_alt.value(),
450 opts.to_c(), &ptr, &count),
451 "icrs_altitude::altitude_ranges");
RAII Star handle, Planet value type, and catalog helpers.
RAII handle to a Star (opaque Rust object).
const SiderustStar * c_handle() const
Access the raw C handle (for passing to altitude functions).
Coordinate module umbrella.
Error handling and utility base for the siderust C++ wrapper.
std::vector< CrossingEvent > crossings_from_c(siderust_crossing_event_t *ptr, uintptr_t count)
siderust_subject_t make_star_subject(const SiderustStar *h)
Build a siderust_subject_t for a star, borrowing the handle.
siderust_subject_t make_body_subject(SiderustBody b)
Build a siderust_subject_t for a solar-system body.
std::vector< CulminationEvent > culminations_from_c(siderust_culmination_event_t *ptr, uintptr_t count)
siderust_subject_t make_icrs_subject(const siderust_spherical_dir_t &dir)
Build a siderust_subject_t for a fixed ICRS direction.
std::vector< Period< TT, MJD > > periods_from_c(tempoch_period_mjd_t *ptr, uintptr_t count)
std::vector< Period< TT, MJD > > below_threshold(const spherical::direction::ICRS &dir, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when a fixed ICRS direction is below a threshold.
std::vector< Period< TT, MJD > > altitude_ranges(const spherical::direction::ICRS &dir, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_alt, qtty::Degree max_alt, const SearchOptions &opts={})
Find periods when a fixed ICRS direction's altitude is within [min, max].
std::vector< Period< TT, MJD > > above_threshold(const spherical::direction::ICRS &dir, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when a fixed ICRS direction is above a threshold.
qtty::Radian altitude_at(const spherical::direction::ICRS &dir, const Geodetic &obs, const Time< TT, MJD > &mjd)
Compute altitude (radians) for a fixed ICRS direction.
std::vector< Period< TT, MJD > > below_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when the Moon is below a threshold altitude.
std::vector< Period< TT, MJD > > altitude_ranges(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_alt, qtty::Degree max_alt, const SearchOptions &opts={})
Find periods when the Moon's altitude is within [min, max].
std::vector< CulminationEvent > culminations(const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
Find culmination events for the Moon.
qtty::Radian altitude_at(const Geodetic &obs, const Time< TT, MJD > &mjd)
Compute the Moon's altitude (radians) at a given Time<TT, MJD> instant.
std::vector< CrossingEvent > crossings(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find threshold-crossing events for the Moon.
std::vector< Period< TT, MJD > > above_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when the Moon is above a threshold altitude.
std::vector< CulminationEvent > culminations(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
Find culmination events for a star.
qtty::Radian altitude_at(const Star &s, const Geodetic &obs, const Time< TT, MJD > &mjd)
Compute a star's altitude (radians) at a given Time<TT, MJD> instant.
std::vector< Period< TT, MJD > > below_threshold(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when a star is below a threshold altitude.
std::vector< Period< TT, MJD > > above_threshold(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when a star is above a threshold altitude.
std::vector< CrossingEvent > crossings(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find threshold-crossing events for a star.
qtty::Radian altitude_at(const Geodetic &obs, const Time< TT, MJD > &mjd)
Compute the Sun's altitude (radians) at a given Time<TT, MJD> instant.
std::vector< Period< TT, MJD > > altitude_ranges(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_alt, qtty::Degree max_alt, const SearchOptions &opts={})
Find periods when the Sun's altitude is within [min, max].
std::vector< Period< TT, MJD > > above_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when the Sun is above a threshold altitude.
std::vector< Period< TT, MJD > > below_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find periods when the Sun is below a threshold altitude.
std::vector< CrossingEvent > crossings(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
Find threshold-crossing events for the Sun.
std::vector< CulminationEvent > culminations(const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
Find culmination events for the Sun.
tempoch::EncodedTime< Scale, Format > Time
void check_status(siderust_status_t status, const char *operation)
tempoch::Period< Time< Scale, Format > > Period
A threshold-crossing event (rising or setting).
CrossingDirection direction
static CrossingEvent from_c(const siderust_crossing_event_t &c)
A culmination (local altitude extremum) event.
static CulminationEvent from_c(const siderust_culmination_event_t &c)
Geodetic position (WGS84 ellipsoid).
siderust_geodetic_t to_c() const
Convert to C FFI struct.
Options for altitude search algorithms.
siderust_search_opts_t to_c() const
SearchOptions & with_tolerance(qtty::Day tolerance)
Set time tolerance.
A direction on the celestial sphere, compile-time tagged by frame.
siderust_spherical_dir_t to_c() const
Public siderust time tags and typed time/period aliases.