6  Visualizing the data

6.1 RGB, NIC and CIR preview

Preview RGB with the scale. In all of the following functions, you can call the extent argument.

# Preview RGB
p_rgb <- reflectance |>
  # Plot
1  plot_raster_rgb(
2    calibration = pixel_to_distance(hsi_tools_core)
  )

# Print
p_rgb
1
Function to plot RGB.
2
Call to HSItools core output of the Shiny app storing the depth calibration.

Plot of RGB data with depth scale.

6.2 Index map

For example, we can plot the spatial map of RABD660:670max.

# Plot RABD
p_rabd <- rabd_max |>
1  plot_raster_proxy(
2    hsi_index = names(rabd),
3    calibration = pixel_to_distance(hsi_tools_core),
4    palette = "viridis",
  )

# Print
p_rabd
1
Function to plot index map.
2
Name specification.
3
Call to HSItools core output of the Shiny app storing the depth calibration.
4
Palette of choice, one of the {viridis} options.

Plot of RABD660:670max data with depth scale.

6.3 Index plot

We can extract profile of the selected index using one of the predefined ROIs. We use the small, green ROI in the middle.

Preview of ROIs
# Plot series
p_rabd_series <- rabd |>
  # Plot
1  HSItools::plot_profile_spectral_series(
2    hsi_index = names(rabd),
3    calibration = pixel_to_distance(hsi_tools_core),

# Print
p_rabd_series
1
Function to plot index profile.
2
Name specification.
3
Call to HSItools core output of the Shiny app storing the depth calibration.

Profile of RABD660:670max using the small ROI.

We can display it side by side using the magic of {patchwork}.

# Plot using {patchwork}
p_rgb + p_rabd + p_rabd_series

RGB, RABD660:670max map and RABD660:670max profile.

6.4 Spectrum plot

Finally, you might be interested in plotting the average spectrum from the selected area. We’ll use the uppermost “sample” from the ROI preview.

# Plot reflectance profile
p_sample <- reflectance |>
1  plot_profile_spectral_profile()

# Print
p_sample
1
Function to plot spectral profile.

Reflectance profile of the topmost “sample” area.