The intersection of zenith rings and azimuth sectors forms a grid whose cells
are circular trapezoids. By default, IDs encode both components as
sectorID * 1000 + ringID. If first_ring_different = TRUE, the zenith ring
is not subdivided.
The code below outputs a comprehensive list of valid values for angle_width.
For convenience, the column radians_denom can be used to provide
angle_width as 180 / radians_denom_i, where radians_denom_i is a value
taken from radians_denom.
df <- data.frame(degrees = 90 / 1:180)deg_to_pi_expr <- function(deg) {
frac <- MASS::fractions(deg / 180)
strsplit(as.character(frac), "/")[[1]][2] %>% as.numeric()
}
df$radians_denom <- sapply(df$degrees, function(deg) deg_to_pi_expr(deg))
z <- zenith_image(10, lens())
a <- azimuth_image(z)
u <- c()
for (i in 1:nrow(df)) {
u <- c(u, tryCatch(is((sky_grid_segmentation(z, a,
180/df$radians_denom[i])), "SpatRaster"),
error = function(e) FALSE))
}
df <- df[u, ]
df