FlwdirRaster#
|
Flow direction raster array parsed to general actionable format. |
Input/Output#
|
Flow direction raster array parsed to actionable format. |
|
Flow direction raster derived from digital elevation data based on steepest gradient. |
|
Return 2D flow direction raster. |
Load serialized FlwdirRaster object from file |
|
Serialize object to file using pickle library. |
Flow direction attributes#
The following attributes describe the flow direction and are at the core to the object.
Linear indices of downstream cell. |
|
Linear indices of main upstream cell, i.e. the upstream cell with the largest contributing area. |
|
Linear indices of valid cells ordered from down- to upstream. |
|
Linear indices of pits/outlets. |
|
Cell Rank, i.e. distance to the outlet in no. |
|
True if the flow direction map is valid. |
|
Boolean array of valid cells in flow direction raster. |
|
Cell area [m] |
|
Distance to outlet [m] |
|
Number of upstream connection |
Flow direction methods#
|
Order cells from down- to upstream. |
|
|
|
Add pits the flow direction raster. |
Repair loops by setting a pit at every cell which does not drain to a pit. |
|
|
Returns each flow direction as a linestring geo-feature |
Raster & geospatial attributes and methods#
The FlwdirRaster object contains FlwdirRaster.shape
, FlwdirRaster.transform
and FlwdirRaster.latlon
attributes describing its geospatial location. The first
attribute is required at initializiation, while the others can be set later.
|
Set transform affine. |
|
Returns linear cell indices based on x, y coordinates. |
|
Returns x, y coordinates of the cell center based on linear cell indices. |
Returns the raster bounding box [xmin, ymin, xmax, ymax]. |
|
Returns the raster extent in cartopy format [xmin, xmax, ymin, ymax]. |
Streams and flow paths#
|
Returns the Strahler (default) or classic stream order map. |
|
Returns paths of indices in down- or upstream direction from the starting points until: 1) a pit is found (including) or now more upstream cells are found; or 2) a True cell is found in mask (including); or 3) the max_length threshold is exceeded. |
|
Returns the last index in down- or upstream direction from the starting points where: |
|
Returns linear indices of most downstream cells within region |
|
Returns linear indices of most upstream cells within region |
|
Returns distance to outlet or next downstream True cell in mask |
|
Returns a list of stream segment as linestring geo-features. |
|
Returns a geo-features of flowpaths defined by a list of arrays of linear indices. |
(Sub)basins#
|
Returns a (sub)basin map with a unique ID for every (sub)basin. |
|
Returns a subbasin map with unique IDs and its outlet linear indices. |
|
Returns the pfafstetter subbasins. |
|
Returns map with basin IDs, with a minimal area of area_min. |
|
Returns the linear index of the outlet cell of basins. |
|
Returns a the basin boundaries. |
Up- and downstream values#
|
Returns next downstream value. |
|
Returns sum of next upstream values. |
Up- and downstream arithmetics#
|
Return accumulated data values along the flow directions. |
|
Returns the upstream area map based on the flow direction map. |
|
Take the moving weighted average over the flow direction network |
|
Take the moving median over the flow direction network |
|
Return smoothed river length, by taking the window average of river length. |
|
Returns data where cells with nodata value have been filled with the nearest up- or downstream valid neighbor value. |
Upscale and subgrid methods#
|
Upscale flow direction network to lower resolution. |
|
Returns an array with ones (True) where the upscaled flow directions are valid and zeros (False) where erroneous. |
|
Returns the subgrid river length [m] based on unit catchment outlet locations. |
|
Returns the subgrid river slope [m/m] estimated at unit catchment outlet pixel. |
|
Returns the average value over the subgrid river, based on unit catchment outlet locations. |
|
Returns the median value over the subgrid river, based on unit catchment outlet locations. |
|
Returns the unit catchment map (highres) and area (lowres) [m2]. |
|
Returns linear indices of unit catchment outlet pixel. |
Elevation#
|
Returns the hydrologically adjusted elevation where each downstream cell has the same or lower elevation as the current cell. |
|
Returns the hydrologically adjusted elevation where for each cell river cell there is an adjacent D4 connected cell which has has the same or lower elevation as the current cell. |
|
Returns the height above the nearest drain (HAND), i.e.: the relative vertical distance (drop) to the nearest dowstream river based on drainage-normalized topography and flowpaths. |
|
Returns floodplain boundaries based on a maximum treshold (h) of HAND which is scaled with upstream area (A) following h ~ A**b. |