xrspatial.flood.curve_number_runoff#

xrspatial.flood.curve_number_runoff(rainfall: DataArray, curve_number: float | DataArray, name: str = 'curve_number_runoff') DataArray[source]#

Estimate runoff depth using the SCS/NRCS curve number method.

Computes:

S  = (25400 / CN) - 254
Ia = 0.2 * S
Q  = (P - Ia)^2 / (P + 0.8 * S)   where P > Ia
Q  = 0                               where P <= Ia
Parameters:
  • rainfall (xarray.DataArray) – 2D rainfall depth raster in millimetres (>= 0).

  • curve_number (float or xarray.DataArray) – SCS curve number, range (0, 100]. A scalar applies uniformly; a DataArray allows spatially varying CN.

  • name (str, default 'curve_number_runoff') – Name of the output DataArray.

Returns:

2D float64 runoff depth in millimetres.

Return type:

xarray.DataArray

Notes

Supports NumPy, CuPy, Dask with NumPy, and Dask with CuPy backed xarray DataArrays. NaN in rainfall or curve_number propagates to NaN in the output.

Examples

>>> import numpy as np
>>> import xarray as xr
>>> from xrspatial import curve_number_runoff
>>> rainfall = xr.DataArray(
...     np.array([[10.0, 50.0], [100.0, 150.0]]), dims=['y', 'x'])
>>> runoff = curve_number_runoff(rainfall, curve_number=80.0)