siderust-cpp 0.8.0
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
observatories.hpp
Go to the documentation of this file.
1#pragma once
2
8#include "coordinates.hpp"
9#include "ffi_core.hpp"
10
11namespace siderust {
12
13namespace detail {
14
16 siderust_geodetic_t out;
17 check_status(siderust_observatory_roque_de_los_muchachos(&out), "ROQUE_DE_LOS_MUCHACHOS");
18 return Geodetic::from_c(out);
19}
20
22 siderust_geodetic_t out;
23 check_status(siderust_observatory_el_paranal(&out), "EL_PARANAL");
24 return Geodetic::from_c(out);
25}
26
28 siderust_geodetic_t out;
29 check_status(siderust_observatory_mauna_kea(&out), "MAUNA_KEA");
30 return Geodetic::from_c(out);
31}
32
34 siderust_geodetic_t out;
35 check_status(siderust_observatory_la_silla(&out), "LA_SILLA_OBSERVATORY");
36 return Geodetic::from_c(out);
37}
38
39} // namespace detail
40
44inline Geodetic geodetic(double lon_deg, double lat_deg, double height_m = 0.0) {
45 siderust_geodetic_t out;
46 check_status(siderust_geodetic_new(lon_deg, lat_deg, height_m, &out), "geodetic");
47 return Geodetic::from_c(out);
48}
49
55 return s;
56}
57
61inline const Geodetic &EL_PARANAL() {
62 static const Geodetic s = detail::make_el_paranal();
63 return s;
64}
65
69inline const Geodetic &MAUNA_KEA() {
70 static const Geodetic s = detail::make_mauna_kea();
71 return s;
72}
73
78 static const Geodetic s = detail::make_la_silla();
79 return s;
80}
81
82// Backward-compatible function aliases.
84inline Geodetic el_paranal() { return EL_PARANAL(); }
85inline Geodetic mauna_kea() { return MAUNA_KEA(); }
87
88} // namespace siderust
Coordinate module umbrella.
Error handling and utility base for the siderust C++ wrapper.
Geodetic make_el_paranal()
Geodetic make_roque_de_los_muchachos()
Geodetic make_mauna_kea()
Geodetic make_la_silla()
const Geodetic & ROQUE_DE_LOS_MUCHACHOS()
Roque de los Muchachos Observatory (La Palma, Spain).
const Geodetic & EL_PARANAL()
El Paranal Observatory (Chile).
void check_status(siderust_status_t status, const char *operation)
Definition ffi_core.hpp:111
Geodetic geodetic(double lon_deg, double lat_deg, double height_m=0.0)
Create a custom geodetic position (WGS84).
Geodetic mauna_kea()
const Geodetic & LA_SILLA_OBSERVATORY()
La Silla Observatory (Chile).
const Geodetic & MAUNA_KEA()
Mauna Kea Observatory (Hawaii, USA).
Geodetic la_silla()
Geodetic roque_de_los_muchachos()
Geodetic el_paranal()
Geodetic position (WGS84 ellipsoid).
Definition geodetic.hpp:29
static Geodetic from_c(const siderust_geodetic_t &c)
Create from C FFI struct.
Definition geodetic.hpp:47