class UniformPrecipitator

UniformPrecipitator

terrainbento UniformPrecipitator.

class UniformPrecipitator(grid, rainfall_flux=1.0)[source]

Bases: object

Generate uniform precipitation.

UniformPrecipitator populates the at-node field “rainfall__flux” with a value provided by the keyword argument rainfall_flux.

To make discharge proprortional to drainage area, use the default value of 1.

Examples

>>> from landlab import RasterModelGrid
>>> from terrainbento import UniformPrecipitator
>>> grid = RasterModelGrid((5,5))
>>> precipitator = UniformPrecipitator(grid, rainfall_flux=3.4)
>>> grid.at_node["rainfall__flux"].reshape(grid.shape)
array([[ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4]])
>>> precipitator.run_one_step(10)
>>> grid.at_node["rainfall__flux"].reshape(grid.shape)
array([[ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4],
       [ 3.4,  3.4,  3.4,  3.4,  3.4]])
__init__(grid, rainfall_flux=1.0)[source]
Parameters
  • grid (model grid) –

  • rainfall_flux (float, optional) – Rainfall flux. Default value is 1.0.

run_one_step(step)[source]

Run UniformPrecipitator forward by duration step