extract_rel_radiance: Extract relative radiance

View source: R/extract_rel_radiance.R

extract_rel_radianceR Documentation

Extract relative radiance

Description

Extract the radiance relative to the zenith radiance

Usage

extract_rel_radiance(r, z, a, sky_points, no_of_points = 3, use_window = TRUE)

Arguments

r

SpatRaster. The image from which the argument sky_points was obtained.

z

SpatRaster built with zenith_image().

a

SpatRaster built with azimuth_image().

sky_points

The output of extract_sky_points() or an object of the same class and structure.

no_of_points

Numeric vector of length one. The number of near-zenith points required for the estimation of the zenith DN.

use_window

Logical vector of length one. If TRUE, a window of 3 \times 3 pixels will be used to extract the digital number from r.

Details

Interpolate the no_of_points closer to the zenith using IDW with p = 2.

Value

A list of three objects, zenith_dn and max_zenith_angle from the class numeric, and sky_points of the class data.frame; zenith_dn is the estimated zenith digital number, max_zenith_angle is the maximum zenith angle reached in the search for near-zenith sky points, and sky_points is the input argument sky_points with the additional columns: a, z, dn, and rr, which stand for azimuth and zenith angle in degrees, digital number, and relative radiance, respectively. If NULL is provided as no_of_points, then zenith_dn is forced to one and, therefore, dn and rr will be identical.

Note

As an alternative, both ImageJ and HSP software package \insertCiteLang2013rcaiman can be used to manually digitize points. See extract_dn() and read_manual_input() for details.

References

\insertAllCited

See Also

Other Tool Functions: calc_oor_index(), calc_spherical_distance(), colorfulness(), correct_vignetting(), defuzzify(), display_caim(), extract_dn(), extract_feature(), extract_sky_points(), extract_sun_coord(), find_sky_pixels(), masking(), optim_dist_to_black(), optim_normalize(), percentage_of_clipped_highlights(), read_bin(), read_caim(), read_caim_raw(), read_ootb_sky_model(), sor_filter(), vicinity_filter(), write_bin(), write_caim(), write_ootb_sky_model()

Examples

## Not run: 
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)

# See fit_cie_sky_model() for details on the CSV file
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)
rr <- extract_rel_radiance(caim$Blue, z, a, sky_points, 1)
points(rr$sky_points$col, nrow(caim) - rr$sky_points$row, col = 3, pch = 0)

## End(Not run)

GastonMauroDiaz/rcaiman documentation built on April 14, 2025, 9:39 a.m.