The goal of neonhs is to make data from the National Ecological Observatory Network (NEON) Airborne Observation Platform (AOP) hyperspectral instrument easier to use. The NEON AOP collects hyperspectral imagery via its at a 1 meter spatial resolution for 426 different wavelengths.

Installation

You can install the development version of neonhs via:

Examples

Extract spectra at spatial point locations

If you need to extract spectra at spatial points, there is a hs_extract_pts function that extracts values from bands efficiently, without needing to first create a raster object.

For example, we may want to extract spectra for every band at the following two points, defined in a SpatialPointsDataFrame. Note also that we can use the hs_proj4string function to get the proj4string representation of the coordinate reference system used in the hyperspectral image.

pts <- SpatialPointsDataFrame(coords = data.frame(x = c(257025, 257011),
                                                  y = c(4111982, 4111991)), 
                              data = data.frame(id = 1:2),
                              proj4string = CRS(hs_proj4string(path_to_file)))
plot(r[[1]], axes = FALSE, box = FALSE)
plot(pts, add = TRUE)

To do this efficiently, you can use hs_extract_pts:

Now we have columns with band indices and wavelengths, which we can use to plot spectra, e.g.,