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

Target implementation for solar-system bodies. More...

#include "altitude.hpp"
#include "azimuth.hpp"
#include "ffi_core.hpp"
#include "trackable.hpp"
#include <string>
Include dependency graph for body_target.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  siderust::BodyTarget
 Target implementation for solar-system bodies. More...
 

Namespaces

namespace  siderust
 
namespace  siderust::body
 

Enumerations

enum class  siderust::Body : int32_t {
  siderust::Sun = SIDERUST_BODY_SUN , siderust::Moon = SIDERUST_BODY_MOON , siderust::Mercury = SIDERUST_BODY_MERCURY , siderust::Venus = SIDERUST_BODY_VENUS ,
  siderust::Mars = SIDERUST_BODY_MARS , siderust::Jupiter = SIDERUST_BODY_JUPITER , siderust::Saturn = SIDERUST_BODY_SATURN , siderust::Uranus = SIDERUST_BODY_URANUS ,
  siderust::Neptune = SIDERUST_BODY_NEPTUNE
}
 Identifies a solar-system body for generic altitude/azimuth dispatch. More...
 

Functions

qtty::Radian siderust::body::altitude_at (Body b, const Geodetic &obs, const Time< TT, MJD > &mjd)
 Compute a body's altitude (radians) at a given Time<TT, MJD> instant.
 
std::vector< Period< TT, MJD > > siderust::body::above_threshold (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Find periods when a body is above a threshold altitude.
 
std::vector< Period< TT, MJD > > siderust::body::below_threshold (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Find periods when a body is below a threshold altitude.
 
std::vector< CrossingEventsiderust::body::crossings (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree threshold, const SearchOptions &opts={})
 Find threshold-crossing events for a body.
 
std::vector< CulminationEventsiderust::body::culminations (Body b, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
 Find culmination events for a body.
 
std::vector< Period< TT, MJD > > siderust::body::altitude_ranges (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min_alt, qtty::Degree max_alt, const SearchOptions &opts={})
 Find periods when a body's altitude is within [min, max].
 
qtty::Radian siderust::body::azimuth_at (Body b, const Geodetic &obs, const Time< TT, MJD > &mjd)
 Compute a body's azimuth (radians) at a given Time<TT, MJD> instant.
 
std::vector< AzimuthCrossingEventsiderust::body::azimuth_crossings (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree bearing, const SearchOptions &opts={})
 Find azimuth-bearing crossing events for a body.
 
std::vector< AzimuthExtremumsiderust::body::azimuth_extrema (Body b, const Geodetic &obs, const Period< TT, MJD > &window, const SearchOptions &opts={})
 Find azimuth extrema (northernmost/southernmost bearing) for a body.
 
std::vector< Period< TT, MJD > > siderust::body::in_azimuth_range (Body b, const Geodetic &obs, const Period< TT, MJD > &window, qtty::Degree min, qtty::Degree max, const SearchOptions &opts={})
 Find periods when a body's azimuth is within [min, max].
 

Detailed Description

Target implementation for solar-system bodies.

BodyTarget implements the Target interface for any solar-system body identified by the Body enum. It dispatches altitude and azimuth computations through the siderust-ffi siderust_body_* functions, which in turn use VSOP87 (planets), specialised engines (Sun/Moon), or Meeus/Williams series (Pluto) for ephemeris.

Example

using namespace siderust;
BodyTarget mars(Body::Mars);
std::cout << mars.name() << "\n"; // "Mars"
qtty::Degree alt = mars.altitude_at(obs, now);
// Polymorphic usage
std::vector<std::unique_ptr<Target>> targets;
targets.push_back(std::make_unique<BodyTarget>(Body::Sun));
targets.push_back(std::make_unique<BodyTarget>(Body::Jupiter));
for (const auto& t : targets) {
std::cout << t->name() << ": " << t->altitude_at(obs, now) << "\n";
}
Target implementation for solar-system bodies.

Definition in file body_target.hpp.