siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
star_target.hpp
Go to the documentation of this file.
1#pragma once
2
18#include "altitude.hpp"
19#include "azimuth.hpp"
20#include "bodies.hpp"
21#include "trackable.hpp"
22
23namespace siderust {
24
32class StarTarget : public Target {
33public:
38 explicit StarTarget(const Star &star) : star_(star) {}
39
40 // ------------------------------------------------------------------
41 // Identity (implements Target)
42 // ------------------------------------------------------------------
43
47 std::string name() const override { return star_.name(); }
48
49 // ------------------------------------------------------------------
50 // Altitude queries
51 // ------------------------------------------------------------------
52
53 qtty::Degree altitude_at(const Geodetic &obs, const Time<TT, MJD> &mjd) const override {
54 // star_altitude::altitude_at returns Radian; convert to Degree
55 auto rad = star_altitude::altitude_at(star_, obs, mjd);
56 return rad.to<qtty::Degree>();
57 }
58
59 std::vector<Period<TT, MJD>> above_threshold(const Geodetic &obs, const Period<TT, MJD> &window,
60 qtty::Degree threshold,
61 const SearchOptions &opts = {}) const override {
62 return star_altitude::above_threshold(star_, obs, window, threshold, opts);
63 }
64
65 std::vector<Period<TT, MJD>> below_threshold(const Geodetic &obs, const Period<TT, MJD> &window,
66 qtty::Degree threshold,
67 const SearchOptions &opts = {}) const override {
68 return star_altitude::below_threshold(star_, obs, window, threshold, opts);
69 }
70
71 std::vector<CrossingEvent> crossings(const Geodetic &obs, const Period<TT, MJD> &window,
72 qtty::Degree threshold,
73 const SearchOptions &opts = {}) const override {
74 return star_altitude::crossings(star_, obs, window, threshold, opts);
75 }
76
77 std::vector<CulminationEvent> culminations(const Geodetic &obs, const Period<TT, MJD> &window,
78 const SearchOptions &opts = {}) const override {
79 return star_altitude::culminations(star_, obs, window, opts);
80 }
81
82 // ------------------------------------------------------------------
83 // Azimuth queries
84 // ------------------------------------------------------------------
85
86 qtty::Degree azimuth_at(const Geodetic &obs, const Time<TT, MJD> &mjd) const override {
87 return star_altitude::azimuth_at(star_, obs, mjd);
88 }
89
90 std::vector<AzimuthCrossingEvent>
91 azimuth_crossings(const Geodetic &obs, const Period<TT, MJD> &window, qtty::Degree bearing,
92 const SearchOptions &opts = {}) const override {
93 return star_altitude::azimuth_crossings(star_, obs, window, bearing, opts);
94 }
95
97 const Star &star() const { return star_; }
98
99private:
100 const Star &star_;
101};
102
103} // namespace siderust
Altitude computations for Sun, Moon, stars, and arbitrary ICRS directions.
Azimuth computations for Sun, Moon, stars, and arbitrary ICRS directions.
RAII Star handle, Planet value type, and catalog helpers.
Target implementation wrapping a const Star&.
std::vector< CrossingEvent > crossings(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={}) const override
Find threshold-crossing events (rising / setting).
std::vector< AzimuthCrossingEvent > azimuth_crossings(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree bearing, const SearchOptions &opts={}) const override
Find epochs when the object crosses a given azimuth bearing.
std::vector< CulminationEvent > culminations(const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={}) const override
Find culmination (local altitude extremum) events.
std::vector< Period< TT, MJD > > below_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={}) const override
Find periods when the object is below a threshold altitude.
qtty::Degree altitude_at(const Geodetic &obs, const Time< TT, MJD > &mjd) const override
Compute altitude (degrees) at a given Time<TT, MJD> instant.
qtty::Degree azimuth_at(const Geodetic &obs, const Time< TT, MJD > &mjd) const override
Compute azimuth (degrees, N-clockwise) at a given Time<TT, MJD> instant.
std::string name() const override
Returns the star's catalog name (delegates to Star::name()).
std::vector< Period< TT, MJD > > above_threshold(const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={}) const override
Find periods when the object is above a threshold altitude.
StarTarget(const Star &star)
Wrap a Star reference as a Target.
const Star & star() const
Access the underlying Star reference.
RAII handle to a Star (opaque Rust object).
Definition bodies.hpp:176
std::string name() const
Definition bodies.hpp:251
Abstract base for any celestial object that can be tracked from an observer location.
Definition trackable.hpp:54
std::vector< AzimuthCrossingEvent > azimuth_crossings(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree bearing, const SearchOptions &opts={})
Find epochs when a star crosses a given azimuth bearing.
Definition azimuth.hpp:283
std::vector< CulminationEvent > culminations(const Star &s, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
Find culmination events for a star.
Definition altitude.hpp:365
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.
Definition altitude.hpp:308
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.
Definition altitude.hpp:335
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.
Definition altitude.hpp:319
qtty::Degree azimuth_at(const Star &s, const Geodetic &obs, const Time< TT, MJD > &mjd)
Compute a star's azimuth (degrees, N-clockwise) at a given Time<TT, MJD> instant.
Definition azimuth.hpp:272
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.
Definition altitude.hpp:351
tempoch::EncodedTime< Scale, Format > Time
Definition time.hpp:36
tempoch::Period< Time< Scale, Format > > Period
Definition time.hpp:37
Geodetic position (WGS84 ellipsoid).
Definition geodetic.hpp:29
Options for altitude search algorithms.
Definition altitude.hpp:58
Abstract base class for all celestial targets.