This function identifies the cells that are within a basin. The runoff produced by those cells will be used, either to calculate the water availability or to compare the simulated variable with the observed runoff in certain streamflow gauges.
cellBasins(gruLoc, basins)a list that comprise two dataframes. The first one, the list of cells in each of the basins contained in the shapefile (cellBasins),
and second a table that associates the coordinates of each cell with the assigned number (cellTable).
raster (SpatRaster from terra, or an object convertible to it, such as a
RasterLayer) that was used to build the GRUs. In this function it is used to number each cell
from West to East and from North to South.
polygons (SpatVector from terra, or an object convertible to it, such as a
SpatialPolygonsDataFrame) comprising each one of the basins where the modeller wants to know the runoff.
It must be in the same projection as the gruLoc raster.
Pedro Felipe Arboleda Obando <pfarboledao@unal.edu.co>
Nicolas Duque Gardeazabal <nduqueg@unal.edu.co>
Carolina Vega Viviescas <cvegav@unal.edu.co>
David Zamora <dazamoraa@unal.edu.co>
Water Resources Engineering Research Group - GIREH Universidad Nacional de Colombia - sede Bogota
data("GRU","basins")
cellBasins <- cellBasins(GRU, basins)
Run the code above in your browser using DataLab