siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
subject.hpp File Reference

Unified Subject type — one value to represent any celestial entity. More...

#include "altitude.hpp"
#include "azimuth.hpp"
#include "bodies.hpp"
#include "body_target.hpp"
#include "coordinates.hpp"
#include "ffi_core.hpp"
#include "target.hpp"
#include "time.hpp"
#include <vector>
Include dependency graph for subject.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  siderust::Subject
 Unified, lightweight handle representing any celestial subject. More...
 

Namespaces

namespace  siderust
 

Enumerations

enum class  siderust::SubjectKind : int32_t { siderust::Body = SIDERUST_SUBJECT_KIND_T_BODY , siderust::Star = SIDERUST_SUBJECT_KIND_T_STAR , siderust::Icrs = SIDERUST_SUBJECT_KIND_T_ICRS , siderust::GenericTarget = SIDERUST_SUBJECT_KIND_T_GENERIC_TARGET }
 Discriminant for the active field in a Subject. More...
 

Functions

qtty::Radian siderust::altitude_at (const Subject &subj, const Geodetic &obs, const Time< TT, MJD > &mjd)
 Altitude at an instant (radians) for any subject.
 
std::vector< Period< TT, MJD > > siderust::above_threshold (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Periods when a subject is above a threshold altitude.
 
std::vector< Period< TT, MJD > > siderust::below_threshold (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Periods when a subject is below a threshold altitude.
 
std::vector< CrossingEventsiderust::crossings (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Threshold-crossing events for a subject.
 
std::vector< CulminationEventsiderust::culminations (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
 Culmination (local extrema) events for a subject.
 
std::vector< Period< TT, MJD > > siderust::altitude_ranges (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_alt, qtty::Degree max_alt, const SearchOptions &opts={})
 Periods when a subject's altitude is within [min, max].
 
qtty::Degree siderust::azimuth_at (const Subject &subj, const Geodetic &obs, const Time< TT, MJD > &mjd)
 Azimuth at an instant (degrees, N-clockwise) for any subject.
 
std::vector< AzimuthCrossingEventsiderust::azimuth_crossings (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree bearing, const SearchOptions &opts={})
 Azimuth bearing-crossing events for a subject.
 
std::vector< AzimuthExtremumsiderust::azimuth_extrema (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
 Azimuth extrema (northernmost / southernmost) for a subject.
 
std::vector< Period< TT, MJD > > siderust::in_azimuth_range (const Subject &subj, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_deg, qtty::Degree max_deg, const SearchOptions &opts={})
 Periods when a subject's azimuth is within [min_deg, max_deg].
 

Detailed Description

Unified Subject type — one value to represent any celestial entity.

Subject is a lightweight tagged value (akin to std::variant) that wraps the FFI siderust_subject_t struct. It can carry:

Kind Data
Body siderust::Body discriminant
Star borrows an existing siderust::Star
Icrs inline spherical::Direction<frames::ICRS>
Target borrows an existing DirectionTarget<…>

All unified functions (altitude_at, above_threshold, …) accept a Subject so the caller no longer needs separate sun::, moon::, body::, star::, icrs::, and target-specific calls.

Lifetime: when constructing from Star or DirectionTarget, the Subject borrows the handle — the original object must outlive it.

Example

using namespace siderust;
// From a solar-system body
Subject sun = Subject::body(Body::Sun);
qtty::Degree alt = altitude_at(sun, obs, now);
// From a catalog star
Star vega = Star::catalog("VEGA");
Subject s = Subject::star(vega);
auto periods = above_threshold(s, obs, window, qtty::Degree(10));
// From an ICRS direction
qtty::Degree(279.23), qtty::Degree(38.78)));
RAII handle to a Star (opaque Rust object).
Definition bodies.hpp:176
Unified, lightweight handle representing any celestial subject.
Definition subject.hpp:82
A direction on the celestial sphere, compile-time tagged by frame.
Definition spherical.hpp:50

Definition in file subject.hpp.