ana5Utils.DFAPathGeneration.leastCostPath
- leastCostPath(startCell, goalCell, fieldPFT, demRaster, csz, ftThreshold, upSlopePenalty, flowDistPenalty)[source]
Dijkstra least-cost path between two cells of the dem grid
The cost of an edge is its horizontal length plus a penalty on the positive elevation gain and a penalty on the distance (m) of the target cell from the flow footprint, so that the path descends along the deposit.
- Parameters
startCell, goalCell (tuple) – (row, col) of the start and goal cells
fieldPFT (numpy array) – peak flow thickness field used to build the flow footprint
demRaster (numpy array) – dem raster of the same shape
csz (float) – cell size (m)
ftThreshold (float) – minimum flow thickness (m) for a cell to belong to the flow footprint
upSlopePenalty (float) – cost multiplier on the positive elevation gain of an edge
flowDistPenalty (float) – cost multiplier on the distance (m) of a cell from the flow footprint
- Returns
cellPath – (row, col) cells from start to goal, empty if the goal is unreachable
- Return type
list