# Mask the data
1<- reflectance |>
reflectance_msk # Use terra
2::mask(
terra
roi_msk,3inverse = TRUE)
- 1
- Reflectance data is either in memory or from a disk.
- 2
- {terra} masking funciton.
- 3
- Object with masks.
HSItools offers a way to calculate a few of the most common indices classes used in paleoenvironmental investigations.
Before we calculate the indices we can mask the regions of the data that should not be used in the calculations. Here we assume, that we have the mask ROIs available in the environment. You can mask your data at any point by passing your raster data to mask function.
Here we are using masks from the QGIS path.
# Mask the data
1<- reflectance |>
reflectance_msk # Use terra
2::mask(
terra
roi_msk,3inverse = TRUE)
In every subsequent step it is your choice if you’d like to calculate indices on the full reflectance or the masked one.
The most straightforward index is the mean of the reflectance values of all selected wavelengths within a given pixel. It reflects overall changes in the darkness or brightness of the captured specimen. It can be used to normalize other indices or filter the data, for example by removing too dark pixels.
You can also specify the extent of calculation. You can use this approach within every subsequent function for calculation of an index.
Here we are using ROIs from the QGIS path.
A common index, where typically values starting at 1.0 indicate reflectance of a given substance.
The RABD calculation has variations, but the results are generally not drastically different. You can use predefined values or provide them manually.
The output’s name informs you about the calculated proxy and additional modifications to the reflectance file. Let’s calculate one of the most common indices to estimate the total chloropigments-a: RABD660:670.
In this variant, a minimum reflectance is found in the trough for each pixel and flexibly used for calculations.
# Calculate RABD
1<- reflectance |>
rabd_max 2::calculate_rabd(
HSItools3edges = c(590, 730),
4trough = c(660:670),
5rabd_name = "rabd660670",
6rabd_type = "max")
This classic variant supplies a specific wavelength to calculate RABD for every pixel. Therefore, it is RABD665.
# Calculate RABD
1<- reflectance |>
rabd_strict 2::calculate_rabd(
HSItools3edges = c(590, 730),
4trough = 665,
5rabd_name = "rabd665",
6rabd_type = "strict")
This is variant 2 (strict), with the added shortcut of always finding the middle point between the through edges—a convenience shortcut for some. Here, it equals RABD665.
# Calculate RABD
1<- reflectance |>
rabd_midpoint 2::calculate_rabd(
HSItools3edges = c(590, 730),
4trough = c(660:670),
5rabd_name = "rabd660670",
6rabd_type = "mid")
This is a feature yet to be added.
# Calculate RABA
1<- reflectance |>
raba 2::calculate_raba(
HSItools3edges = c(590, 730),
4trough = c(660:670),
5raba_name = "raba660670")
Another popular and straightforward index is band ratios, where reflectance at wavelength X is divided by reflectance at wavelength Y.
# Calculate ratio
1<- reflectance |>
ratio_570630 2::calculate_band_ratio(
HSItools3edges = c(570, 630),
4ratio_name = "r570r630")
This is a feature yet to be added.
Yet another index is a derivative at a selected wavelength. For example, 550 nm might be diagnostic for Fe-oxides.
Another, simple approach where reflectance at one wavelength is subtracted from the other.
# Calculate the difference
1<- reflectance |>
difference_650675 2::calculate_band_difference(
HSItools3edges = c(650, 675),
4difference_name = "dif650dif670")
This is a feature yet to be added.
This index was introduced in Ghanbari et al. (2023).