write_caim: Write canopy image

View source: R/write_caim.R

write_caimR Documentation

Write canopy image

Description

Wrapper function for terra::writeRaster().

Usage

write_caim(caim, path, bit_depth)

Arguments

caim

SpatRaster.

path

Character vector of length one. Path for writing the image.

bit_depth

Numeric vector of length one.

Value

No return value. Called for side effects.

See Also

Other Tool Functions: colorfulness(), correct_vignetting(), defuzzify(), extract_dn(), extract_feature(), extract_rl(), extract_sky_points_simple(), extract_sky_points(), extract_sun_coord(), find_sky_pixels_nonnull(), find_sky_pixels(), masking(), optim_normalize(), percentage_of_clipped_highlights(), read_bin(), read_caim_raw(), read_caim(), write_bin()

Examples

## Not run: 
caim <- read_caim() %>% normalize(., 0, 255)
write_caim(caim * 2^8-2, file.path(tempdir(), "test_8bit"), 8)
write_caim(caim * 2^16-2, file.path(tempdir(), "test_16bit"), 16)
# Note: the normalized values are scaled by multiplying by 2^bit_depth-2
# to avoid storing in the maximum bin because those values will be
# interpreted as NA by read_caim(), and that is undesired.

## End(Not run)

rcaiman documentation built on Nov. 15, 2023, 1:08 a.m.