Reader¶
The reader module is the core component of hydrodatasource for accessing and reading various hydrological datasets. It provides a unified interface for handling different data sources, with a special focus on custom, user-prepared datasets.
SelfMadeHydroDataset¶
The SelfMadeHydroDataset class is the most important feature of the reader module. It allows you to read your own hydrological data as long as it follows a specific directory structure. This is designed for flexibility, enabling you to work with non-public or specially prepared datasets.
Directory Structure¶
To use SelfMadeHydroDataset, your data should be organized in the following structure:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
attributes/attributes.csv: A CSV file containing static attributes for each basin (e.g., area, slope, land cover). It must contain abasin_idcolumn.shapes/basins.shp: A shapefile containing the geographic boundaries of each basin.timeseries/: This directory holds the time series data, with subdirectories for each time resolution (e.g.,1Dfor daily,3hfor 3-hourly).- Each subdirectory contains CSV files, one for each basin, named with the
basin_id. - Each subdirectory also contains a
*_units_info.jsonfile that specifies the units for the variables in the CSV files.
- Each subdirectory contains CSV files, one for each basin, named with the
Example Usage¶
Here is how you can use SelfMadeHydroDataset to read your data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Other Readers¶
SelfMadeForecastDataset: ExtendsSelfMadeHydroDatasetto support forecast data, which is expected to be in aforecastsdirectory.StationHydroDataset: ExtendsSelfMadeHydroDatasetto include data from gauging stations, which is expected to be in astationsdirectory.