cube_rgb: Plot an RGB composite of the hyperspectral data cube

View source: R/plot_cube.R

cube_rgbR Documentation

Plot an RGB composite of the hyperspectral data cube

Description

A wrapper to build an RGB composite plot.

Usage

cube_rgb(
  cube,
  bands,
  wave = c(650, 570, 480),
  add = FALSE,
  log = FALSE,
  fact = 0.9,
  main = "",
  ...
)

Arguments

cube

A raster stack object returned by the read_cube function.

bands

A numeric vector of length 3 specifying the bands to be used for the composite.

wave

A numeric vector on length 3 specifying the wavelengths to be used the composite. It is an alternative specification of the bands. See Details.

add

Logical. Should the plot be added to a previous plot?

log

Logical. Should the data be scaled in log space?

fact

If log == FALSE, a value for linear scaling.

main

Optional plot title.

Details

As default the function will plot a tru color composite with bands closest the wavelengths 650 nm, 550 nm and 480 nm for the the red, green and channels. Those bands can be changed by specifying the bands directly with the bands argument or by specifying target wavelengths. If wavelengths are specified, the closest available wavelengths to those requested will be used for the composite.

The stretching re-scales the values for a better visual representation of contrast. It can be mapped in log scale or use in a linear scale. If in linear scale, fact is a multiplier of the maximum value in the data set.

Value

Returns the input data invisibly and make a plot of the data.


AlexCast/surfspec documentation built on July 7, 2022, 9:35 a.m.