5  Indices

HSItools offers a way to calculate a few of the most common indices classes used in paleoenvironmental investigations.

5.1 Masking

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.

Mask source

Here we are using masks from the QGIS path.

# Mask the data
1reflectance_msk <- reflectance |>
  # Use terra
2  terra::mask(
    roi_msk,
3    inverse = TRUE)
1
Reflectance data is either in memory or from a disk.
2
{terra} masking funciton.
3
Object with masks.

In every subsequent step it is your choice if you’d like to calculate indices on the full reflectance or the masked one.

5.2 Mean reflectance (Rmean)

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.

# Calculate rmean
1rmean <- reflectance |>
2  HSItools::calculate_rmean()
1
Reflectance data is either in memory or from a disk.
2
Calculation function.

You can also specify the extent of calculation. You can use this approach within every subsequent function for calculation of an index.

ROIs

Here we are using ROIs from the QGIS path.

# Calculate rmean
1rmean <- reflectance |>
2  HSItools::calculate_rmean(
3    extent = roi_sml[1, ]
  )
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Definition of the extent.

5.3 Relative Absorption Band Depth (RABD)

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.

5.3.1 Variant 1 – “max”

In this variant, a minimum reflectance is found in the trough for each pixel and flexibly used for calculations.

# Calculate RABD
1rabd_max <- reflectance |>
2  HSItools::calculate_rabd(
3    edges = c(590, 730),
4    trough = c(660:670),
5    rabd_name = "rabd660670",
6    rabd_type = "max")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Edges of the trough, the broader scope.
4
Trough of interest, a narrower scope to find the reflectance value.
5
Name of the index to be stored in the raster data.
6
Type of the RABD calculation.

5.3.2 Variant 2 – “strict”

This classic variant supplies a specific wavelength to calculate RABD for every pixel. Therefore, it is RABD665.

# Calculate RABD
1rabd_strict <- reflectance |>
2  HSItools::calculate_rabd(
3    edges = c(590, 730),
4    trough = 665,
5    rabd_name = "rabd665",
6    rabd_type = "strict")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Edges of the trough, the broader scope.
4
Trough of interest, a narrower scope to find the reflectance value.
5
Name of the index to be stored in the raster data.
6
Type of the RABD calculation.

5.3.3 Variant 3 – “midpoint”

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
1rabd_midpoint <- reflectance |>
2  HSItools::calculate_rabd(
3    edges = c(590, 730),
4    trough = c(660:670),
5    rabd_name = "rabd660670",
6    rabd_type = "mid")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Edges of the trough, the broader scope.
4
Trough of interest, a narrower scope to find the reflectance value.
5
Name of the index to be stored in the raster data.
6
Type of the RABD calculation.

5.4 Relative Absorption Band Area - ToDo

ToDo

This is a feature yet to be added.

# Calculate RABA
1raba <- reflectance |>
2  HSItools::calculate_raba(
3    edges = c(590, 730),
4    trough = c(660:670),
5    raba_name = "raba660670")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Edges of the trough, the broader scope.
4
Trough of interest, a narrower scope to find the reflectance value.
5
Name of the index to be stored in the raster data.

5.5 Spectral ratios

Another popular and straightforward index is band ratios, where reflectance at wavelength X is divided by reflectance at wavelength Y.

# Calculate ratio
1ratio_570630 <- reflectance |>
2  HSItools::calculate_band_ratio(
3    edges = c(570, 630),
4    ratio_name = "r570r630")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Wavelength X and Y, numerator and denominator.
4
Name of the index to be stored in the raster data.

5.6 Derivatives - ToDo

ToDo

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.

# Calculate derivative
1derivative_550 <- reflectance |>
2  HSItools::calculate_derivative(
3    band = 550,
4    derivative_name = "der550")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Wavelength of choice.
4
Name of the index to be stored in the raster data.

5.7 Differences

Another, simple approach where reflectance at one wavelength is subtracted from the other.

# Calculate the difference
1difference_650675 <- reflectance |>
2  HSItools::calculate_band_difference(
3    edges = c(650, 675),
4    difference_name = "dif650dif670")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Wavelength X and Y.
4
Name of the index to be stored in the raster data.

5.8 Normalized difference index (NDI)

# # Calculate NDI
1ndi_650675 <- reflectance |>
2  HSItools::calculate_ndi(
3    edges = c(650, 675),
4    ndi_name = "ndi650ndi670")
1
Reflectance data is either in memory or from a disk.
2
Calculation function.
3
Wavelength X and Y.
4
Name of the index to be stored in the raster data.

5.9 Other

5.9.1 λ Red Edge Minimum Point (λREMP) - ToDo

ToDo

This is a feature yet to be added.

This index was introduced in Ghanbari et al. (2023).

# Calculate λREMP
1remp <- reflectance |>
2  HSItools::calculate_remp()
1
Reflectance data is either in memory or from a disk.
2
Calculation function.