ewatercycle.observation.grdc module¶
- ewatercycle.observation.grdc.get_grdc_data(station_id: str, start_time: str, end_time: str, parameter: str = 'Q', data_home: Optional[str] = None, column: str = 'streamflow') Tuple[pandas.core.frame.DataFrame, Dict[str, Union[str, int, float]]] ¶
Get river discharge data from Global Runoff Data Centre (GRDC).
Requires the GRDC daily data files in a local directory. The GRDC daily data files can be ordered at https://www.bafg.de/GRDC/EN/02_srvcs/21_tmsrs/riverdischarge_node.html
- Parameters
station_id – The station id to get. The station id can be found in the catalogues at https://www.bafg.de/GRDC/EN/02_srvcs/21_tmsrs/212_prjctlgs/project_catalogue_node.html
start_time – Start time of model in UTC and ISO format string e.g. ‘YYYY-MM-DDTHH:MM:SSZ’.
end_time – End time of model in UTC and ISO format string e.g. ‘YYYY-MM-DDTHH:MM:SSZ’.
parameter – optional. The parameter code to get, e.g. (‘Q’) discharge, cubic meters per second.
data_home – optional. The directory where the daily grdc data is located. If left out will use the grdc_location in the eWaterCycle configuration file.
column – optional. Name of column in dataframe. Default: “streamflow”.
- Returns
grdc data in a dataframe and metadata.
Examples
from ewatercycle.observation.grdc import get_grdc_data df, meta = get_grdc_data('6335020', '2000-01-01T00:00Z', '2001-01-01T00:00Z', data_home='.') df.describe() streamflow count 4382.000000 mean 2328.992469 std 1190.181058 min 881.000000 25% 1550.000000 50% 2000.000000 75% 2730.000000 max 11300.000000 meta {'grdc_file_name': '/home/myusername/git/eWaterCycle/ewatercycle/6335020_Q_Day.Cmd.txt', 'id_from_grdc': 6335020, 'file_generation_date': '2019-03-27', 'river_name': 'RHINE RIVER', 'station_name': 'REES', 'country_code': 'DE', 'grdc_latitude_in_arc_degree': 51.756918, 'grdc_longitude_in_arc_degree': 6.395395, 'grdc_catchment_area_in_km2': 159300.0, 'altitude_masl': 8.0, 'dataSetContent': 'MEAN DAILY DISCHARGE (Q)', 'units': 'm³/s', 'time_series': '1814-11 - 2016-12', 'no_of_years': 203, 'last_update': '2018-05-24', 'nrMeasurements': 'NA', 'UserStartTime': '2000-01-01T00:00Z', 'UserEndTime': '2001-01-01T00:00Z', 'nrMissingData': 0}