Skip to content

Commit

Permalink
adding back wavelength_names arg
Browse files Browse the repository at this point in the history
  • Loading branch information
adelegem committed Nov 25, 2024
1 parent 64c61de commit ddbe190
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion R/extract_pixel_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#'
#' @param raster_files directory of input raster files
#' @param aoi_files area of interest file - shapefile containing one or more site polygons for each raster
#' @param wavelength_names the wavelength corresponding to each layer of the raster_files
#' @return a df with pixel values for each of the image layers
#' @examples
#' aoi_files <- list.files('inst/extdata/aoi',
#' pattern = 'image_aoi.shp$', full.names = TRUE)
#' raster_files <- list.files('inst/extdata/multiband_image',
#' pattern = '.tif$', full.names = TRUE)
#' pixelvalues <- extract_pixel_values(raster_files, aoi_files)
#' pixelvalues <- extract_pixel_values(raster_files, aoi_files, c('blue','green','red','red_edge','nir'))
#' @export

extract_pixel_values <- function(raster_files, aoi_files, wavelength_names){
Expand Down
6 changes: 4 additions & 2 deletions man/extract_pixel_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-drone_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_that("extract_pixel_values works", {
pattern = '.tif$', full.names = TRUE
)
pixelvalues <- extract_pixel_values(
raster_files, aoi_files
raster_files, aoi_files, c('blue','green','red','red_edge','nir')
)
expect_true(dim(pixelvalues)[1] > 2000000)
expect_true(mean(pixelvalues[,3]) > 0.05 & mean(pixelvalues[,3]) < 0.06)
Expand Down

0 comments on commit ddbe190

Please sign in to comment.