Converts a Digital Elevation Model (DEM) to a Relative Elevation Model (REM). An REM is a DEM normalized to the baseline elevation of the stream reach.
detrend(dem, flowline, flowline_points, buffer_distance)
a list containing two terra SpatRaster objects: * rem - A raster Relative Elevation Model (REM) representing elevation above the baseline elevation of the reach. * trend - A raster trend surface representing the baseline elevation of the flowline_points for the reach.