priority_flow.cal_stream_order ============================== .. py:module:: priority_flow.cal_stream_order .. autoapi-nested-parse:: Calculate Stream Order functions for PriorityFlow. This module provides functions for calculating Strahler stream orders using stream segments delineated using the CalcSubbasins function. Functions --------- .. autoapisummary:: priority_flow.cal_stream_order.calc_stream_order Module Contents --------------- .. py:function:: calc_stream_order(basin_id: numpy.ndarray, ds_id: numpy.ndarray, segments: Optional[numpy.ndarray] = None) -> Dict[str, Union[numpy.ndarray, numpy.ndarray]] Calculate Strahler stream orders using stream segments delineated using the CalcSubbasins function. :param basin_id: An array of basin IDs (can be obtained from the CalcSubbasins function Summary output column 1 "Basin_ID") :type basin_id: np.ndarray :param ds_id: Downstream basin IDs, the downstream ID of each basin, should be corresponding to the basin ID (can be obtained from the CalcSubbasins function Summary output Column 6 "Downstream_Basin_ID") :type ds_id: np.ndarray :param segments: A channel mask with segments assigned with basin IDs (can use the CalcSubbasins 'segments' output for this) :type segments: np.ndarray, optional :returns: A dictionary containing: - 'summary': A summary table with a row for every basin with three columns "Basin_ID", "Downstream_ID", "StreamOrder_number" - 'order_mask': (optional) Only available if segments is an input, this will output a spatial raster with the channel orders :rtype: Dict[str, np.ndarray] .. rubric:: Notes This function implements the Strahler stream ordering system where: - First-order streams are those without any tributaries - When two streams of the same order join, the resulting stream is of the next higher order - When streams of different orders join, the resulting stream maintains the higher order