rOPTRAM: Deriving Soil Moisture from Satellite Imagery in R

Soil moisture at the Earth’s surface is essential in many hydrological, pedological, and biological processes. Earth observations from satellites have been recognized as the most efficient and reliable means for assessing soil water content. The satellite-derived OPTRAM model has been shown to determine soil moisture over large areas accurately. Spectral data were obtained from different spaceborne systems to calculate several vegetation indices, and the model was adjusted to various SM conditions. The rOPTRAM package allows researchers and practitioners to monitor soil moisture contents at a regional scale and long-time intervals.


Statement of Need
Soil moisture (SM) at the Earth's surface is essential in many hydrological, pedological, and biological processes.Pasture is the most common land use, where grazing livestock spreads over about 77% of the global agricultural land, and supports billions of inhabitants (Maestre et al., 2022;Ramankutty et al., 2008).Therefore SM is a critical resource in these regions for the growth of palatable plants, pasture quality, and rangeland health (Kusserow, 2017;Mbow et al., 2021).A time series of SM measurements can determine the quality and potential for grazing.By following seasonal variations in SM, forecasts for preferred grazing lands can be prepared.In-situ volumetric soil content is typically measured using Time Domain Reflectometer (TDR) sensors with a high temporal resolution (Kirkham, 2014).TDR sensors have been recognized to be very accurate and can function for long periods.However these data are point measurements and cannot cover the extensive areas needed for determining regional scale grazing potential.Cosmic Ray Neutron Scanner (CRNS) technology can also acquire SM measurements at high temporal resolution, with a larger spatial scale than TDR, covering up to 30 hectares.These latter instruments are, however, quite expensive, and less accurate than TDR spot measurements (Davies et al., 2022;Schrön et al., 2017).To overcome the locality issue, Earth observations from satellites are the most efficient and reliable means for assessing the Earth's resources, including SM due to its large-scale coverage and repeatability for the last decades.
Less than a decade ago, Sadeghi et al. (2017) showed that shortwave infrared (SWIR) Transformed Reflectance (STR) is applicative to assess SM.They developed a novel physicalbased model, OPtical TRApezoid Model (OPTRAM) using designated spectral bands of remote sensing imagery.OPTRAM was recently validated (Longo-Minnolo et al., 2022) to address the need to estimate SM over vast areas at regional scales.The model can now be applied to various earth observation systems, such as Sentinel-2 or Landsat, with visible, near-infrared, and SWIR bands.(Ambrosone et al., 2020;Dubinin et al., 2020).
The overarching goal of the current project was to program the original OPTRAM algorithm, with some improvements, using the open-source R language.The spectral data were obtained from different spaceborne systems to calculate several vegetation indices, and the model was adjusted to various SM conditions.

Algorithm
rOPTRAM produces a large dataset of pixel values of two satellite-derived raster layers: a vegetation index (VI), such as the Normalized Difference Vegetation Index (NDVI) and the SWIR transformed reflectance (STR).All pairs of pixel values at all acquired image dates are plotted as a scatter plot.Then regression lines are extracted at both the upper ("wet") and lower ("dry") bounds of the scatter plot.The slopes and intercepts of these lines are the model coefficients used to derive a spatially explicit soil moisture map.This soil moisture map is calculated using the equations developed by Sadeghi et al. (2017).In his original work, Sadeghi et al. (2017) visually examined the scatterplot to locate the trapezoid edges.
The new rOPTRAM package, on the other hand, delineates the upper and lower, "wet" and "dry" bounds of the STR/VI scatterplot programmatically, through the following approach.Sentinel-2 images are acquired using the CDSE package (Karaman, 2023), clipped to the study area, for the user-specified time range.The Application Programming Interface (API) request sent to the Copernicus DataSpace Ecosystem1 (CDSE) prepares both VI and STR indices.All pixel values for both indices, and all images along the time series are collected into a table and plotted as a scatterplot.The VI axis of the scatterplot is divided, programmatically, into a series of small intervals, and a subset of the STR values, within that narrow interval of VI is extracted.Outlier STR values are removed based on the accepted 1.5 times Inter Quartile Range (IQR) method.Then, among the remaining values, the top and bottom 2% quartiles of these STR values are found for each interval.The upper and lower quartile values are paired with the VI values for each interval, thus collecting points along both the "wet" and "dry trapezoid edges.Each of these two sets typically consists of 50 to 100 points.This approach offers a mathematically robust and repeatable implementation of the OPTRAM model.
One of three possible equations is fitted to each of these "wet" and "dry" sets of trapezoid edges (Figure Figure 1.A linear Ordinary Least Squares (OLS) regression line is fitted to each set of points in the most straightforward case.The intercept and slope of these lines give the coefficients for calculating soil water content.Two additional fitted options are implemented in rOPTRAM: exponential and second-order polynomial.For OLS-fitted curves, two coefficients are derived for each line, the slope and intercept.Similarly, the exponential fitted curve requires two coefficients, the intercept and the multiplier of VI in the exponential term.A polynomial fit, on the other hand, consists of 3 coefficients, the intercept, and the coefficients for the first-order and second-order terms.