16#include <tempoch/ffi_core.hpp>
19using QttyQuantity = qtty_quantity_t;
23#include "siderust_ffi.h"
111inline void check_status(siderust_status_t status,
const char *operation) {
112 if (status == SIDERUST_STATUS_T_OK)
115 std::string msg = std::string(operation) +
" failed: ";
117 case SIDERUST_STATUS_T_NULL_POINTER:
119 case SIDERUST_STATUS_T_INVALID_FRAME:
121 case SIDERUST_STATUS_T_INVALID_CENTER:
123 case SIDERUST_STATUS_T_TRANSFORM_FAILED:
125 case SIDERUST_STATUS_T_INVALID_BODY:
127 case SIDERUST_STATUS_T_UNKNOWN_STAR:
129 case SIDERUST_STATUS_T_INVALID_PERIOD:
131 case SIDERUST_STATUS_T_ALLOCATION_FAILED:
133 case SIDERUST_STATUS_T_INVALID_ARGUMENT:
135 case SIDERUST_STATUS_T_INTERNAL_PANIC:
137 case SIDERUST_STATUS_T_DATA_ERROR:
138 throw DataLoadError(msg +
"data loading error (I/O, download, or parse)");
139 case SIDERUST_STATUS_T_OUT_OF_RANGE:
141 case SIDERUST_STATUS_T_NO_EOP_DATA:
142 throw NoEopDataError(msg +
"Earth Orientation Parameters unavailable for epoch");
143 case SIDERUST_STATUS_T_INVALID_DIMENSION:
152 tempoch::check_status(status, operation);
170 ICRS = SIDERUST_FRAME_T_ICRS,
176 ECEF = SIDERUST_FRAME_T_ECEF,
177 Galactic = SIDERUST_FRAME_T_GALACTIC,
178 GCRS = SIDERUST_FRAME_T_GCRS,
181 CIRS = SIDERUST_FRAME_T_CIRS,
182 TIRS = SIDERUST_FRAME_T_TIRS,
183 ITRF = SIDERUST_FRAME_T_ITRF,
184 ICRF = SIDERUST_FRAME_T_ICRF,
196 Iau2000A = SIDERUST_EARTH_ORIENTATION_MODEL_T_IAU2000_A,
197 Iau2000B = SIDERUST_EARTH_ORIENTATION_MODEL_T_IAU2000_B,
198 Iau2006 = SIDERUST_EARTH_ORIENTATION_MODEL_T_IAU2006,
199 Iau2006A = SIDERUST_EARTH_ORIENTATION_MODEL_T_IAU2006_A,
203 Rising = SIDERUST_CROSSING_DIRECTION_T_RISING,
204 Setting = SIDERUST_CROSSING_DIRECTION_T_SETTING,
208 Max = SIDERUST_CULMINATION_KIND_T_MAX,
209 Min = SIDERUST_CULMINATION_KIND_T_MIN,
219 return os <<
"rising";
221 return os <<
"setting";
223 return os <<
"unknown";
233 return os <<
"unknown";
239 return os <<
"Iau2000A";
241 return os <<
"Iau2000B";
243 return os <<
"Iau2006";
245 return os <<
"Iau2006A";
247 return os <<
"Unknown";
251 MuAlpha = SIDERUST_RA_CONVENTION_T_MU_ALPHA,
252 MuAlphaStar = SIDERUST_RA_CONVENTION_T_MU_ALPHA_STAR,
259 siderust_subject_t s{};
260 s.kind = SIDERUST_SUBJECT_KIND_T_BODY;
267 siderust_subject_t s{};
268 s.kind = SIDERUST_SUBJECT_KIND_T_STAR;
275 siderust_subject_t s{};
276 s.kind = SIDERUST_SUBJECT_KIND_T_ICRS;
283 siderust_subject_t s{};
284 s.kind = SIDERUST_SUBJECT_KIND_T_GENERIC_TARGET;
285 s.generic_target_handle = h;
AllocationFailedError(const std::string &msg)
DataLoadError(const std::string &msg)
InternalPanicError(const std::string &msg)
InvalidArgumentError(const std::string &msg)
InvalidBodyError(const std::string &msg)
InvalidCenterError(const std::string &msg)
InvalidDimensionError(const std::string &msg)
InvalidFrameError(const std::string &msg)
InvalidPeriodError(const std::string &msg)
NoEopDataError(const std::string &msg)
NullPointerError(const std::string &msg)
OutOfRangeError(const std::string &msg)
SiderustException(const std::string &msg)
UnknownStarError(const std::string &msg)
siderust_subject_t make_generic_target_subject(const SiderustGenericTarget *h)
Build a siderust_subject_t for a generic target opaque handle.
siderust_subject_t make_star_subject(const SiderustStar *h)
Build a siderust_subject_t for a star, borrowing the handle.
siderust_subject_t make_body_subject(SiderustBody b)
Build a siderust_subject_t for a solar-system body.
siderust_subject_t make_icrs_subject(const siderust_spherical_dir_t &dir)
Build a siderust_subject_t for a fixed ICRS direction.
void check_status(siderust_status_t status, const char *operation)
std::ostream & operator<<(std::ostream &os, AzimuthExtremumKind kind)
Stream operator for AzimuthExtremumKind.
void check_tempoch_status(tempoch_status_t status, const char *operation)
Backward-compatible wrapper — delegates to tempoch::check_status.
uint32_t ffi_version()
Returns the siderust-ffi ABI version (major*10000 + minor*100 + patch).
@ Max
Northernmost (or easternmost) direction reached by the body.
@ Min
Southernmost (or westernmost) direction reached by the body.