fastscapelib.FlowKernelEroder¶
- class fastscapelib.FlowKernelEroder(flow_graph, **kwargs)¶
Abstract flow kernel eroder class.
This helper class is for implementing a custom eroder based on a Numba flow kernel. It has the following abstract methods that must be implemented in subclasses:
kernel_funcis the kernel function (see alsocreate_flow_kernel())param_specandinput_specshould return the names and types of the eroder parameters and inputs, respectively.kernel_apply_dirshould return the direction / order in which the kernel function is applied on the flow graph.
This class provides one pre-defined “erosion” output variable for the flow kernel function. It also provides the same API than other eroder classes in Fastscapelib, i.e., an
erodemethod that takes input variable values as arguments and that returns the amount erosion computed for one time step.Eroder parameter values should be passed as arguments of the subclass’
__init__method, in addition to the parameters below. Those parameters may also be exposed as properties of the eroder subclass.- Parameters:
flow_graph (
FlowGraph) – Flow graph instance.**kwargs – Keyword arguments that are passed to
create_flow_kernel().
- __init__(flow_graph, **kwargs)¶
Methods
__init__(flow_graph, **kwargs)erode(**kwargs)Compute and returns the amount of erosion for one time step.
Returns a dictionary with input variable names and their (numba) value type.
Returns the kernel application direction and order.
kernel_func(node)The eroder flow kernel function.
Returns a dictionary with parameter names and their (numba) value type.
Attributes
Returns the flow graph object used by this eroder.
Returns the (Numba) flow kernel object used by this eroder.
Returns the (Numba) flow kernel data object used by this eroder.
- abstract static param_spec()¶
Returns a dictionary with parameter names and their (numba) value type.
- abstract static input_spec()¶
Returns a dictionary with input variable names and their (numba) value type.
- abstract static kernel_apply_dir()¶
Returns the kernel application direction and order.
- Return type:
- property kernel: NumbaFlowKernel¶
Returns the (Numba) flow kernel object used by this eroder.
- property kernel_data: NumbaFlowKernelData¶
Returns the (Numba) flow kernel data object used by this eroder.