write_sky_points {rcaiman} | R Documentation |
Write sky points
Description
Create a special file to interface with the HSP software.
Usage
write_sky_points(sky_points, path_to_HSP_project, img_name)
Arguments
sky_points |
An object of the class data.frame. The result of a
calling to |
path_to_HSP_project |
Character vector of length one. Path to the HSP project folder. For instance, "C:/Users/johndoe/Documents/HSP/Projects/my_prj/". |
img_name |
Character vector of length one. For instance, "DSCN6342.pgm" or "DSCN6342". See details. |
Details
This function is part of a workflow that connects this package with the HSP software package (Lang et al. 2013).
This function was designed to be called after
extract_sky_points()
. The r
argument provided to
extract_sky_points()
should be an image pre-processed by the HSP
software. Those images are stored as PGM files in the subfolder "manipulate"
of the project folder (which will be in turn a subfolder of the
"projects" folder). Those PGM files can be read with
read_caim()
.
The img_name
argument of write_sky_points()
should be the name
of the file associated to the aforementioned r
argument.
The following code exemplifies how this package can be used in conjunction with the HSP software. The code assumes that the user is working within an RStudio project located in the HSP project folder.
r <- read_caim("manipulate/IMG_1014.pgm") plot(r) z <- zenith_image(ncol(r), lens()) a <- azimuth_image(z) g <- sky_grid_segmentation(z, a, 10) mblt <- ootb_mblt(r, z, a)$bin bin <- mask_hs(z, 0, 85) & bin sun_coord <- extract_sun_coord(r, z, a, bin, g) write_sun_coord(sun_coord$row_col, ".", "IMG_1014") sky_points <- extract_sky_points(r, bin, g) write_sky_points(sky_points, ".", "IMG_1014")
Value
None. A file will be written in the HSP project folder.
References
Lang M, Kodar A, Arumäe T (2013). “Restoration of above canopy reference hemispherical image from below canopy measurements for plant area index estimation in forests.” Forestry Studies, 59(1), 13–27. doi:10.2478/fsmu-2013-0008.
See Also
Other HSP Functions:
read_manual_input()
,
read_opt_sky_coef()
,
row_col_from_zenith_azimuth()
,
write_sun_coord()
,
zenith_azimuth_from_row_col()