
Calculate depth to a water-table or potentiometric surface
ps_depth_to_water_surface.RdCalculates land-surface elevation minus modeled head after explicit geometry, unit, and vertical-datum checks. Negative values are preserved. For a confined surface the product is depth to the potentiometric surface, not necessarily depth to the water table.
Examples
h <- terra::rast(nrows = 2, ncols = 2, xmin = 0, xmax = 2, ymin = 0, ymax = 2,
crs = "EPSG:26920", vals = c(9, 11, 8, 10))
land <- h * 0 + 10
z <- ps_depth_to_water_surface(h, land, "potentiometric")
terra::values(z$depth)
#> depth_to_potentiometric_surface
#> [1,] 1
#> [2,] -1
#> [3,] 2
#> [4,] 0
# Negative values are retained for hydrogeologic and datum review.