Grid element mappers that are specific to raster grids.
map_sum_of_inlinks_to_node (grid, var_name[, out]) |
Map the sum of links entering a node to the node. |
map_mean_of_inlinks_to_node (grid, var_name) |
Map the mean of links entering a node to the node. |
map_max_of_inlinks_to_node (grid, var_name[, out]) |
Map the maximum of links entering a node to the node. |
map_min_of_inlinks_to_node (grid, var_name[, out]) |
Map the minimum of links entering a node to the node. |
map_sum_of_outlinks_to_node (grid, var_name) |
Map the sum of links leaving a node to the node. |
map_mean_of_outlinks_to_node (grid, var_name) |
Map the mean of links leaving a node to the node. |
map_max_of_outlinks_to_node (grid, var_name) |
Map the max of links leaving a node to the node. |
map_min_of_outlinks_to_node (grid, var_name) |
Map the min of links leaving a node to the node. |
map_mean_of_links_to_node (grid, var_name[, out]) |
Map the mean of links touching a node to the node. |
map_mean_of_horizontal_links_to_node (grid, ...) |
Map the mean of links in the x direction touching a node to the node. |
map_mean_of_horizontal_active_links_to_node (...) |
Map the mean of active links in the x direction touching node to the node. |
map_mean_of_vertical_links_to_node (grid, ...) |
Map the mean of links in the y direction touching a node to the node. |
map_mean_of_vertical_active_links_to_node (...) |
Map the mean of active links in the y direction touching node to the node. |
map_max_of_inlinks_to_node
(grid, var_name, out=None)[source]¶Map the maximum of links entering a node to the node.
map_max_of_inlinks_to_node takes an array at the links and finds the inlink values for each node in the grid. it finds the maximum value at the the inlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_max_of_inlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_max_of_inlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_max_of_inlinks_to_node(rmg, 'z')
array([ 0., 0., 1., 2.,
3., 7., 8., 9.,
10., 14., 15., 16.])
LLCATS: NINF LINF MAP
map_max_of_outlinks_to_node
(grid, var_name, out=None)[source]¶Map the max of links leaving a node to the node.
map_max_of_outlinks_to_node takes an array at the links and finds the outlink values for each node in the grid. it finds the maximum value at the the outlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_max_of_outlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_max_of_outlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_max_of_outlinks_to_node(rmg, 'z')
array([ 3., 4., 5., 6., 10., 11., 12., 13., 14., 15., 16.,
0.])
LLCATS: NINF LINF MAP
map_mean_of_horizontal_active_links_to_node
(grid, var_name, out=None)[source]¶Map the mean of active links in the x direction touching node to the node.
map_mean_of_horizontal_active_links_to_node takes an array at the links and finds the average of all horizontal (x-direction) link neighbor values for each node in the grid. It returns an array at the nodes of the mean of these values. If a link is absent, it is ignored. If a node has no active links, it receives 0. Note that here a positive returned value means flux to the east, and a negative to the west.
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_horizontal_active_links_to_node
>>> from landlab import RasterModelGrid, CLOSED_BOUNDARY
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', -np.arange(17, dtype=float))
>>> rmg.status_at_node[rmg.nodes_at_left_edge] = CLOSED_BOUNDARY
>>> map_mean_of_horizontal_active_links_to_node(rmg, 'z')
array([ 0. , 0. , 0. , 0. , 0. , -8. , -8.5, -9. , 0. , 0. , 0. ,
0. ])
LLCATS: NINF LINF MAP
map_mean_of_horizontal_links_to_node
(grid, var_name, out=None)[source]¶Map the mean of links in the x direction touching a node to the node.
map_mean_of_horizontal_links_to_node takes an array at the links and finds the average of all horizontal (x-direction) link neighbor values for each node in the grid. It returns an array at the nodes of the mean of these values. If a link is absent, it is ignored. Note that here a positive returned value means flux to the east, and a negative to the west.
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_horizontal_links_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_mean_of_horizontal_links_to_node(rmg, 'z')
array([ 0. , 0.5, 1.5, 2. , 7. , 7.5, 8.5, 9. , 14. ,
14.5, 15.5, 16. ])
LLCATS: NINF LINF MAP
map_mean_of_inlinks_to_node
(grid, var_name, out=None)[source]¶Map the mean of links entering a node to the node.
map_mean_of_inlinks_to_node takes an array at the links and finds the inlink values for each node in the grid. It finds the average of the inlinks and returns values at the nodes.
This considers all inactive links to have a value of 0.
Construction:
map_mean_of_inlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_inlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_mean_of_inlinks_to_node(rmg, 'z')
array([ 0. , 0. , 0.5, 1. , 1.5, 5.5, 6.5, 7.5, 5. ,
12.5, 13.5, 14.5])
LLCATS: NINF LINF MAP
map_mean_of_links_to_node
(grid, var_name, out=None)[source]¶Map the mean of links touching a node to the node.
map_mean_all_links_to_node takes an array at the links and finds the average of all ~existing~ link neighbor values for each node in the grid. it returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_mean_of_links_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_links_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_mean_of_links_to_node(rmg, 'z')
array([ 1.5 , 1.66666667, 2.66666667, 4. ,
6.66666667, 7.5 , 8.5 , 9.33333333,
12. , 13.33333333, 14.33333333, 14.5 ])
LLCATS: NINF LINF MAP
map_mean_of_outlinks_to_node
(grid, var_name, out=None)[source]¶Map the mean of links leaving a node to the node.
map_mean_of_outlinks_to_node takes an array at the links and finds the outlink values for each node in the grid. it finds the average of the outlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_mean_of_outlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_outlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_mean_of_outlinks_to_node(rmg, 'z')
array([ 1.5, 2.5, 3.5, 3. , 8.5, 9.5, 10.5, 6.5, 7. ,
7.5, 8. , 0. ])
LLCATS: NINF LINF MAP
map_mean_of_vertical_active_links_to_node
(grid, var_name, out=None)[source]¶Map the mean of active links in the y direction touching node to the node.
map_mean_of_vertical_active_links_to_node takes an array at the links and finds the average of all vertical (y-direction) link neighbor values for each node in the grid. It returns an array at the nodes of the mean of these values. If a link is absent, it is ignored. If a node has no active links, it receives 0. Note that here a positive returned value means flux to the north, and a negative to the south.
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_vertical_active_links_to_node
>>> from landlab import RasterModelGrid, CLOSED_BOUNDARY
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', -np.arange(17, dtype=float))
>>> rmg.status_at_node[rmg.nodes_at_bottom_edge] = CLOSED_BOUNDARY
>>> map_mean_of_vertical_active_links_to_node(rmg, 'z')
array([ 0., 0., 0., 0., 0., -11., -12., 0., 0., -11., -12.,
0.])
LLCATS: NINF LINF MAP
map_mean_of_vertical_links_to_node
(grid, var_name, out=None)[source]¶Map the mean of links in the y direction touching a node to the node.
map_mean_of_vertical_links_to_node takes an array at the links and finds the average of all vertical (y-direction) link neighbor values for each node in the grid. It returns an array at the nodes of the mean of these values. If a link is absent, it is ignored. Note that here a positive returned value means flux to the north, and a negative to the south.
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_mean_of_vertical_links_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_mean_of_vertical_links_to_node(rmg, 'z')
array([ 3. , 4. , 5. , 6. , 6.5, 7.5, 8.5, 9.5, 10. ,
11. , 12. , 13. ])
LLCATS: NINF LINF MAP
map_min_of_inlinks_to_node
(grid, var_name, out=None)[source]¶Map the minimum of links entering a node to the node.
map_min_of_inlinks_to_node takes an array at the links and finds the inlink values for each node in the grid. it finds the minimum value at the the inlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_min_of_inlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_min_of_inlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_min_of_inlinks_to_node(rmg, 'z')
array([ 0., 0., 0., 0., 0., 4., 5., 6., 0., 11., 12.,
13.])
LLCATS: NINF LINF MAP
map_min_of_outlinks_to_node
(grid, var_name, out=None)[source]¶Map the min of links leaving a node to the node.
map_min_of_outlinks_to_node takes an array at the links and finds the outlink values for each node in the grid. It finds the minimum value at the the outlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_min_of_outlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_min_of_outlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_min_of_outlinks_to_node(rmg, 'z')
array([ 0., 1., 2., 0., 7., 8., 9., 0., 0., 0., 0., 0.])
LLCATS: NINF LINF MAP
map_sum_of_inlinks_to_node
(grid, var_name, out=None)[source]¶Map the sum of links entering a node to the node.
map_sum_of_inlinks_to_node takes an array at the links and finds the inlink values for each node in the grid. it sums the inlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_sum_of_inlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_sum_of_inlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_sum_of_inlinks_to_node(rmg, 'z')
array([ 0., 0., 1., 2., 3., 11., 13., 15., 10., 25., 27.,
29.])
LLCATS: NINF LINF MAP
map_sum_of_outlinks_to_node
(grid, var_name, out=None)[source]¶Map the sum of links leaving a node to the node.
map_sum_of_outlinks_to_node takes an array at the links and finds the outlink values for each node in the grid. it sums the outlinks and returns values at the nodes.
Note
This considers all inactive links to have a value of 0.
Construction:
map_sum_of_outlinks_to_node(grid, var_name, out=None)
Parameters: | grid : ModelGrid
var_name : array or field name
out : ndarray, optional
|
---|---|
Returns: | ndarray
|
Examples
>>> import numpy as np
>>> from landlab.grid.raster_mappers import map_sum_of_outlinks_to_node
>>> from landlab import RasterModelGrid
>>> rmg = RasterModelGrid((3, 4))
>>> _ = rmg.add_field('link', 'z', np.arange(17.))
>>> map_sum_of_outlinks_to_node(rmg, 'z')
array([ 3., 5., 7., 6., 17., 19., 21., 13., 14., 15., 16.,
0.])
LLCATS: NINF LINF MAP