16#include <qtty/qtty.hpp>
24 SiderustSkyGridCell *
ptr =
nullptr;
49 qtty::Degree(c.altitude_deg)),
50 qtty::Steradian(c.solid_angle_sr)};
67 SkyGrid(
double alt_min,
double alt_max,
double alt_step,
double az_step,
bool equal_area)
68 : alt_min_(alt_min), alt_max_(alt_max), alt_step_(alt_step), az_step_(az_step),
74 return SkyGrid(0.0, 90.0, step.value(), step.value(),
false);
79 return SkyGrid(0.0, 90.0, alt_step.value(), az_step.value(),
false);
84 return SkyGrid(0.0, 90.0, alt_step.value(), az_step_at_horizon.value(),
true);
89 alt_min_ = lo.value();
90 alt_max_ = hi.value();
95 std::vector<SkyGridCell>
cells()
const {
96 SiderustSkyGridCell *ptr =
nullptr;
99 siderust_sky_grid_cells(alt_min_, alt_max_, alt_step_, az_step_, equal_area_, &ptr, &count),
106 std::vector<SkyGridCell> result;
107 result.reserve(count);
108 for (uintptr_t i = 0; i < count; ++i) {
Typed hemispherical alt/az grid sampler.
static SkyGrid with_steps(qtty::Degree alt_step, qtty::Degree az_step)
Uniform grid with independent altitude and azimuth steps over [0°, 90°).
SkyGrid & with_alt_range(qtty::Degree lo, qtty::Degree hi)
Restrict the altitude range (builder, e.g. a 10°..90° horizon mask).
std::size_t size() const
Number of cells the grid materialises.
static SkyGrid equal_area(qtty::Degree alt_step, qtty::Degree az_step_at_horizon)
Equal-area grid: azimuth count per altitude ring scales with cos(alt).
std::vector< SkyGridCell > cells() const
Materialise every cell of the grid.
static SkyGrid uniform(qtty::Degree step)
Uniform grid with equal altitude and azimuth steps over [0°, 90°).
Error handling and utility base for the siderust C++ wrapper.
void check_status(siderust_status_t status, const char *operation)
Typed spherical coordinate templates.
A single sky-grid cell: a Horizontal direction and its solid angle.
static SkyGridCell from_c(const SiderustSkyGridCell &c)
spherical::Direction< frames::Horizontal > direction
Alt/az sky direction.
qtty::Steradian solid_angle
Approximate solid angle of the cell.
SiderustSkyGridCell * ptr
SkyGridCellsGuard(SkyGridCellsGuard &&)=delete
SkyGridCellsGuard & operator=(const SkyGridCellsGuard &)=delete
SkyGridCellsGuard()=default
SkyGridCellsGuard(const SkyGridCellsGuard &)=delete
SkyGridCellsGuard & operator=(SkyGridCellsGuard &&)=delete
A direction on the celestial sphere, compile-time tagged by frame.