siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
siderust::DirectionTarget< C > Class Template Reference

Fixed celestial direction target — a Target for a specific sky position. More...

#include <siderust/target.hpp>

Inheritance diagram for siderust::DirectionTarget< C >:
Collaboration diagram for siderust::DirectionTarget< C >:

Public Member Functions

 DirectionTarget (C dir, Time< TT, JD > epoch=Time< TT, JD >::J2000(), std::string label="")
 Construct from a strongly-typed spherical direction.
 
 ~DirectionTarget ()
 
 DirectionTarget (DirectionTarget &&other) noexcept
 Move constructor.
 
DirectionTargetoperator= (DirectionTarget &&other) noexcept
 Move assignment.
 
 DirectionTarget (const DirectionTarget &)=delete
 
DirectionTargetoperator= (const DirectionTarget &)=delete
 
std::string name () const override
 Human-readable name for this direction target.
 
const C & direction () const
 The original typed direction as supplied at construction.
 
Time< TT, JDepoch () const
 Epoch of the coordinate.
 
const spherical::direction::ICRSicrs_direction () const
 
template<typename F_ = Frame, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree ra () const
 Right ascension — only available for equatorial frames (RA/Dec).
 
template<typename F_ = Frame, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree dec () const
 Declination — only available for equatorial frames (RA/Dec).
 
qtty::Degree altitude_at (const Geodetic &obs, const Time< TT, MJD > &mjd) const override
 Compute altitude (degrees) at a given Time<TT, MJD> instant.
 
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 target 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={}) const override
 Find periods when the target is below a threshold altitude.
 
std::vector< CrossingEventcrossings (const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={}) const override
 Find threshold-crossing events (rising / setting).
 
std::vector< CulminationEventculminations (const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={}) const override
 Find culmination (local altitude extremum) events.
 
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::vector< AzimuthCrossingEventazimuth_crossings (const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree bearing, const SearchOptions &opts={}) const override
 Find epochs when the target crosses a given azimuth bearing.
 
const SiderustGenericTarget * c_handle () const
 Access the underlying C handle (advanced use).
 
SiderustGenericTargetData data () const
 Raw coordinate payload stored in the FFI handle.
 
- Public Member Functions inherited from siderust::Target
virtual ~Target ()=default
 
 Target ()=default
 
 Target (const Target &)=delete
 
Targetoperator= (const Target &)=delete
 
 Target (Target &&)=default
 
Targetoperator= (Target &&)=default
 

Detailed Description

template<typename C>
class siderust::DirectionTarget< C >

Fixed celestial direction target — a Target for a specific sky position.

Template Parameters
CSpherical direction type (e.g. spherical::direction::ICRS).

Example — ICRS target (Vega at J2000)

using namespace siderust;
ICRSTarget vega{ spherical::direction::ICRS{ 279.2348_deg, +38.7836_deg } };
auto alt = vega.altitude_at(obs, now); // → qtty::Degree
std::cout << vega.name() << "\n"; // "ICRS(279.23°, 38.78°)"
std::cout << vega.ra() << "\n"; // qtty::Degree (equatorial frames)
Fixed celestial direction target — a Target for a specific sky position.
Definition target.hpp:112
A direction on the celestial sphere, compile-time tagged by frame.
Definition spherical.hpp:50
qtty::Degree ra() const
Definition spherical.hpp:71

Example — named ICRS target

ICRSTarget vega{ spherical::direction::ICRS{ 279.2348_deg, +38.7836_deg },
Time<TT, JD>::J2000(), "Vega" };
std::cout << vega.name() << "\n"; // "Vega"
tempoch::EncodedTime< Scale, Format > Time
Definition time.hpp:36

Example — Ecliptic target (auto-converted to ICRS internally)

spherical::direction::EclipticMeanJ2000{ 246.2_deg, 59.2_deg } };
auto alt = ec.altitude_at(obs, now);
Examples
05_target_tracking.cpp.

Definition at line 112 of file target.hpp.

Constructor & Destructor Documentation

◆ DirectionTarget() [1/3]

template<typename C >
siderust::DirectionTarget< C >::DirectionTarget ( dir,
Time< TT, JD epoch = Time<TTJD>::J2000(),
std::string  label = "" 
)
inlineexplicit

Construct from a strongly-typed spherical direction.

For frames other than ICRS, the direction is converted to ICRS before being registered with the Rust FFI. The original C direction is retained for C++-side accessors.

Parameters
dirSpherical direction (any supported frame).
epochCoordinate epoch (default J2000.0).
labelOptional human-readable name. If empty, a default "Frame(lon°, lat°)" string is generated from the direction.

Definition at line 142 of file target.hpp.

References siderust::check_status(), siderust::spherical::Direction< F >::dec(), siderust::DirectionTarget< C >::epoch(), and siderust::spherical::Direction< F >::ra().

◆ ~DirectionTarget()

template<typename C >
siderust::DirectionTarget< C >::~DirectionTarget ( )
inline

Definition at line 158 of file target.hpp.

◆ DirectionTarget() [2/3]

template<typename C >
siderust::DirectionTarget< C >::DirectionTarget ( DirectionTarget< C > &&  other)
inlinenoexcept

Move constructor.

Definition at line 166 of file target.hpp.

◆ DirectionTarget() [3/3]

template<typename C >
siderust::DirectionTarget< C >::DirectionTarget ( const DirectionTarget< C > &  )
delete

Member Function Documentation

◆ above_threshold()

template<typename C >
std::vector< Period< TT, MJD > > siderust::DirectionTarget< C >::above_threshold ( const Geodetic obs,
const Period< TT, MJD > &  window,
qtty::Degree  threshold,
const SearchOptions opts = {} 
) const
inlineoverridevirtual

Find periods when the target is above a threshold altitude.

Implements siderust::Target.

Definition at line 257 of file target.hpp.

◆ altitude_at()

template<typename C >
qtty::Degree siderust::DirectionTarget< C >::altitude_at ( const Geodetic obs,
const Time< TT, MJD > &  mjd 
) const
inlineoverridevirtual

Compute altitude (degrees) at a given Time<TT, MJD> instant.

Note
The Rust FFI returns radians; this method converts to degrees.

Implements siderust::Target.

Definition at line 246 of file target.hpp.

References siderust::check_status(), siderust::detail::make_generic_target_subject(), and siderust::Geodetic::to_c().

◆ azimuth_at()

template<typename C >
qtty::Degree siderust::DirectionTarget< C >::azimuth_at ( const Geodetic obs,
const Time< TT, MJD > &  mjd 
) const
inlineoverridevirtual

Compute azimuth (degrees, N-clockwise) at a given Time<TT, MJD> instant.

Implements siderust::Target.

Definition at line 318 of file target.hpp.

References siderust::check_status(), siderust::detail::make_generic_target_subject(), and siderust::Geodetic::to_c().

◆ azimuth_crossings()

template<typename C >
std::vector< AzimuthCrossingEvent > siderust::DirectionTarget< C >::azimuth_crossings ( const Geodetic obs,
const Period< TT, MJD > &  window,
qtty::Degree  bearing,
const SearchOptions opts = {} 
) const
inlineoverridevirtual

Find epochs when the target crosses a given azimuth bearing.

Implements siderust::Target.

Definition at line 330 of file target.hpp.

◆ below_threshold()

template<typename C >
std::vector< Period< TT, MJD > > siderust::DirectionTarget< C >::below_threshold ( const Geodetic obs,
const Period< TT, MJD > &  window,
qtty::Degree  threshold,
const SearchOptions opts = {} 
) const
inlineoverridevirtual

Find periods when the target is below a threshold altitude.

Implements siderust::Target.

Definition at line 272 of file target.hpp.

◆ c_handle()

template<typename C >
const SiderustGenericTarget * siderust::DirectionTarget< C >::c_handle ( ) const
inline

Access the underlying C handle (advanced use).

Definition at line 342 of file target.hpp.

Referenced by siderust::Subject::target().

◆ crossings()

template<typename C >
std::vector< CrossingEvent > siderust::DirectionTarget< C >::crossings ( const Geodetic obs,
const Period< TT, MJD > &  window,
qtty::Degree  threshold,
const SearchOptions opts = {} 
) const
inlineoverridevirtual

Find threshold-crossing events (rising / setting).

Implements siderust::Target.

Definition at line 287 of file target.hpp.

◆ culminations()

template<typename C >
std::vector< CulminationEvent > siderust::DirectionTarget< C >::culminations ( const Geodetic obs,
const Period< TT, MJD > &  window,
const SearchOptions opts = {} 
) const
inlineoverridevirtual

Find culmination (local altitude extremum) events.

Implements siderust::Target.

Definition at line 301 of file target.hpp.

◆ data()

template<typename C >
SiderustGenericTargetData siderust::DirectionTarget< C >::data ( ) const
inline

Raw coordinate payload stored in the FFI handle.

Definition at line 345 of file target.hpp.

References siderust::check_status().

◆ dec()

template<typename C >
template<typename F_ = Frame, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree siderust::DirectionTarget< C >::dec ( ) const
inline

Declination — only available for equatorial frames (RA/Dec).

Definition at line 233 of file target.hpp.

◆ direction()

template<typename C >
const C & siderust::DirectionTarget< C >::direction ( ) const
inline

The original typed direction as supplied at construction.

Definition at line 216 of file target.hpp.

◆ epoch()

template<typename C >
Time< TT, JD > siderust::DirectionTarget< C >::epoch ( ) const
inline

Epoch of the coordinate.

Definition at line 219 of file target.hpp.

Referenced by siderust::DirectionTarget< C >::DirectionTarget().

◆ icrs_direction()

template<typename C >
const spherical::direction::ICRS & siderust::DirectionTarget< C >::icrs_direction ( ) const
inline

The ICRS direction used for FFI calls (equals direction() when C is already spherical::direction::ICRS).

Definition at line 223 of file target.hpp.

◆ name()

template<typename C >
std::string siderust::DirectionTarget< C >::name ( ) const
inlineoverridevirtual

Human-readable name for this direction target.

Returns the label passed at construction if one was provided; otherwise generates a "Frame(lon°, lat°)" string from the ICRS direction.

Implements siderust::Target.

Definition at line 202 of file target.hpp.

References siderust::spherical::Direction< F >::dec(), and siderust::spherical::Direction< F >::ra().

◆ operator=() [1/2]

template<typename C >
DirectionTarget & siderust::DirectionTarget< C >::operator= ( const DirectionTarget< C > &  )
delete

◆ operator=() [2/2]

template<typename C >
DirectionTarget & siderust::DirectionTarget< C >::operator= ( DirectionTarget< C > &&  other)
inlinenoexcept

Move assignment.

Definition at line 173 of file target.hpp.

◆ ra()

template<typename C >
template<typename F_ = Frame, std::enable_if_t< frames::has_ra_dec_v< F_ >, int > = 0>
qtty::Degree siderust::DirectionTarget< C >::ra ( ) const
inline

Right ascension — only available for equatorial frames (RA/Dec).

Definition at line 227 of file target.hpp.


The documentation for this class was generated from the following file: