priority_flow.data_loader ========================= .. py:module:: priority_flow.data_loader .. autoapi-nested-parse:: Data loading functions for PriorityFlow package. This module provides functions to load the test data files that were converted from the R package's TestDomain_Inputs directory. Functions --------- .. autoapisummary:: priority_flow.data_loader.load_dem priority_flow.data_loader.load_watershed_mask priority_flow.data_loader.load_river_mask priority_flow.data_loader.load_all_test_data priority_flow.data_loader.get_data_info Module Contents --------------- .. py:function:: load_dem() Load the Digital Elevation Model (DEM) test data. This is a small elevation dataset (215km by 172km at 1km spatial resolution) converted from the R package's TestDomain_Inputs. :returns: A 2D array of elevation values with shape (215, 172) representing the domain dimensions (nrow=215, ncol=172). :rtype: numpy.ndarray .. rubric:: Examples >>> import priority_flow.data_loader as dl >>> dem = dl.load_dem() >>> print(f"DEM shape: {dem.shape}") >>> print(f"Elevation range: {dem.min():.2f} to {dem.max():.2f}") .. py:function:: load_watershed_mask() Load the watershed mask test data. A mask showing the watershed drainage area for the test domain. :returns: A 2D array of 0's and 1's showing the watershed extent (1=inside the watershed, 0=outside the watershed) with shape (215, 172). :rtype: numpy.ndarray .. rubric:: Examples >>> import priority_flow.data_loader as dl >>> mask = dl.load_watershed_mask() >>> print(f"Watershed mask shape: {mask.shape}") >>> print(f"Watershed cells: {np.sum(mask)}") .. py:function:: load_river_mask() Load the river mask test data. A mask showing an example river network for the test domain. :returns: A 2D array of 0's and 1's showing the location of river cells (1=river, 0=non-river) with shape (215, 172). :rtype: numpy.ndarray .. rubric:: Examples >>> import priority_flow.data_loader as dl >>> river_mask = dl.load_river_mask() >>> print(f"River mask shape: {river_mask.shape}") >>> print(f"River cells: {np.sum(river_mask)}") .. py:function:: load_all_test_data() Load all test data files at once. :returns: A dictionary containing all test data arrays with keys: - 'dem': Digital Elevation Model - 'watershed_mask': Watershed drainage area mask - 'river_mask': River network mask :rtype: dict .. rubric:: Examples >>> import priority_flow.data_loader as dl >>> data = dl.load_all_test_data() >>> print(f"Available data: {list(data.keys())}") >>> print(f"DEM shape: {data['dem'].shape}") .. py:function:: get_data_info() Get information about the available test data files. :returns: A dictionary containing metadata about each data file. :rtype: dict