if (FALSE) {
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
# Manual method following Lang et al. (2010)
path <- system.file("external/sky_points.csv",
package = "rcaiman")
sky_points <- read.csv(path)
sky_points <- sky_points[c("Y", "X")]
colnames(sky_points) <- c("row", "col")
head(sky_points)
plot(caim$Blue)
points(sky_points$col, nrow(caim) - sky_points$row, col = 2, pch = 10)
# x11()
# plot(caim$Blue)
# sun_angles <- click(c(z, a), 1) %>% as.numeric()
sun_angles <- c(z = 49.5, a = 27.4) #taken with above lines then hardcoded
sun_row_col <- row_col_from_zenith_azimuth(z, a,
sun_angles["z"],
sun_angles["a"])
points(sun_row_col[2], nrow(caim) - sun_row_col[1],
col = "yellow", pch = 8, cex = 3)
rr <- extract_rr(caim$Blue, z, a, sky_points)
set.seed(7)
model <- fit_cie_model(rr, sun_angles,
general_sky_type = "Clear")
sky_cie <- cie_image(z, a, model$sun_angles, model$coef)
sky_rr <- interpolate_spherical(rr$sky_points, z, a,
filling_source = sky_cie,
w = 1,
k = 10,
p = 2,
angular_radius = 20,
rule = "any",
size = 50)
plot(r/sky_rr/rr$zenith_dn)
}
Run the code above in your browser using DataLab