66 static_cast<bool>(c.waxing)};
88 std::vector<PhaseEvent> result;
89 result.reserve(count);
90 for (uintptr_t i = 0; i < count; ++i) {
93 siderust_phase_events_free(ptr, count);
101 std::vector<Period<TT, MJD>> result;
102 result.reserve(count);
103 for (uintptr_t i = 0; i < count; ++i) {
107 siderust_periods_free(ptr, count);
125 siderust_moon_phase_geometry_t out{};
126 check_status(siderust_moon_phase_geocentric(jd.value(), &out),
"moon::phase_geocentric");
137 siderust_moon_phase_geometry_t out{};
138 check_status(siderust_moon_phase_topocentric(jd.value(), site.
to_c(), &out),
139 "moon::phase_topocentric");
152 siderust_moon_phase_label_t out{};
153 check_status(siderust_moon_phase_label(c, &out),
"moon::phase_label");
166 siderust_phase_event_t *ptr =
nullptr;
168 check_status(siderust_find_phase_events(window.c_inner(), opts.to_c(), &ptr, &count),
169 "moon::find_phase_events");
182 tempoch_period_mjd_t *ptr =
nullptr;
184 check_status(siderust_moon_illumination_above(window.c_inner(), k_min, opts.to_c(), &ptr, &count),
185 "moon::illumination_above");
198 tempoch_period_mjd_t *ptr =
nullptr;
200 check_status(siderust_moon_illumination_below(window.c_inner(), k_max, opts.to_c(), &ptr, &count),
201 "moon::illumination_below");
216 tempoch_period_mjd_t *ptr =
nullptr;
219 siderust_moon_illumination_range(window.c_inner(), k_min, k_max, opts.to_c(), &ptr, &count),
220 "moon::illumination_range");
275 return os <<
"new moon";
277 return os <<
"first quarter";
279 return os <<
"full moon";
281 return os <<
"last quarter";
283 return os <<
"unknown";
292 return os <<
"new moon";
294 return os <<
"waxing crescent";
296 return os <<
"first quarter";
298 return os <<
"waxing gibbous";
300 return os <<
"full moon";
302 return os <<
"waning gibbous";
304 return os <<
"last quarter";
306 return os <<
"waning crescent";
308 return os <<
"unknown";
Altitude computations for Sun, Moon, stars, and arbitrary ICRS directions.
Coordinate module umbrella.
Error handling and utility base for the siderust C++ wrapper.
std::vector< PhaseEvent > phase_events_from_c(siderust_phase_event_t *ptr, uintptr_t count)
std::vector< Period< TT, MJD > > illum_periods_from_c(tempoch_period_mjd_t *ptr, uintptr_t count)
MoonPhaseGeometry phase_topocentric(const Time< TT, JD > &jd, const Geodetic &site)
Compute topocentric Moon phase geometry at a Julian Date.
std::vector< PhaseEvent > find_phase_events(const Period< TT, MJD > &window, const SearchOptions &opts={})
Find principal phase events (new moon, quarters, full moon) in a window.
std::vector< Period< TT, MJD > > illumination_above(const Period< TT, MJD > &window, double k_min, const SearchOptions &opts={})
Find periods when illuminated fraction is ≥ k_min.
MoonPhaseLabel phase_label(const MoonPhaseGeometry &geom)
Determine the descriptive phase label for a given geometry.
MoonPhaseGeometry phase_geocentric(const Time< TT, JD > &jd)
Compute geocentric Moon phase geometry at a Julian Date.
std::vector< Period< TT, MJD > > illumination_below(const Period< TT, MJD > &window, double k_max, const SearchOptions &opts={})
Find periods when illuminated fraction is ≤ k_max.
std::vector< Period< TT, MJD > > illumination_range(const Period< TT, MJD > &window, double k_min, double k_max, const SearchOptions &opts={})
Find periods when illuminated fraction is within [k_min, k_max].
tempoch::EncodedTime< Scale, Format > Time
void check_status(siderust_status_t status, const char *operation)
std::ostream & operator<<(std::ostream &os, AzimuthExtremumKind kind)
Stream operator for AzimuthExtremumKind.
tempoch::Period< Time< Scale, Format > > Period
bool is_waning(MoonPhaseLabel label)
Check if a phase label describes a waning moon.
bool is_waxing(MoonPhaseLabel label)
Check if a phase label describes a waxing moon.
PhaseKind
Principal lunar phase kinds (new-moon quarter events).
double illuminated_percent(const MoonPhaseGeometry &geom)
Get the illuminated fraction as a percentage [0, 100].
MoonPhaseLabel
Descriptive moon phase labels (8 canonical phases).
Geodetic position (WGS84 ellipsoid).
siderust_geodetic_t to_c() const
Convert to C FFI struct.
Geometric description of the Moon's phase at a point in time.
double illuminated_fraction
Illuminated disc fraction in [0, 1].
qtty::Radian elongation
Sun–Moon elongation.
bool waxing
True when the Moon is waxing.
qtty::Radian phase_angle
Phase angle in [0, π].
static MoonPhaseGeometry from_c(const siderust_moon_phase_geometry_t &c)
A principal lunar phase event (new moon, first quarter, etc.).
Time< TT, MJD > time
Epoch of the event (Time<TT, MJD>).
static PhaseEvent from_c(const siderust_phase_event_t &c)
PhaseKind kind
Which principal phase occurred.
Options for altitude search algorithms.
Public siderust time tags and typed time/period aliases.