siderust-cpp
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),
47 "geodetic");
48 return Geodetic::from_c(out);
49}
50
55
60
65
70
71// Backward-compatible function aliases.
73inline Geodetic el_paranal() { return EL_PARANAL; }
74inline Geodetic mauna_kea() { return MAUNA_KEA; }
76
77} // 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()
void check_status(siderust_status_t status, const char *operation)
Definition ffi_core.hpp:81
Geodetic geodetic(double lon_deg, double lat_deg, double height_m=0.0)
Create a custom geodetic position (WGS84).
const Geodetic ROQUE_DE_LOS_MUCHACHOS
Roque de los Muchachos Observatory (La Palma, Spain).
const Geodetic LA_SILLA_OBSERVATORY
La Silla Observatory (Chile).
Geodetic mauna_kea()
Geodetic la_silla()
const Geodetic EL_PARANAL
El Paranal Observatory (Chile).
Geodetic roque_de_los_muchachos()
const Geodetic MAUNA_KEA
Mauna Kea Observatory (Hawaii, USA).
Geodetic el_paranal()
Geodetic position (WGS84 ellipsoid).
Definition geodetic.hpp:28
static Geodetic from_c(const siderust_geodetic_t &c)
Create from C FFI struct.
Definition geodetic.hpp:50