pytuflow.GPKGRL.time_series#
- GPKGRL.time_series(locations, data_types, time_fmt='relative', *args, **kwargs)#
Returns a time-series DataFrame for the given location(s) and data type(s).
It’s possible to pass in a well known shorthand for the data type e.g.
qforflow.The location can also be a filter string, e.g.
lineto extract the time-series values for all line geometry types. The following filters are available for theGPKGRLclass:None: default - returns all available timespoint:line:polygon: (orregion)
The returned column names will be in the format
obj/data_type/locatione.g.po/flow/FC01.1_R. Thedata_typename in the column heading will be identical to the data type name passed into the function e.g. ifhis used instead ofwater level, then the return will bepo/h/FC01.1_R.1.- Parameters:
locations (str | list[str]) – The location to extract the time series data for. If
Noneis passed in, all locations will be returned for the given data_types.data_types (str | list[str]) – The data type to extract the time series data for. If
Noneis passed in, all data types will be returned for the given locations.time_fmt (str, optional) – The format for the time column. Options are
relativeorabsolute.
- Returns:
The time series data.
- Return type:
pd.DataFrame
Examples
Extracting flow for a given line.
>>> res = GPKGRL('/path/to/plot_results_RL.gpkg') >>> res.time_series('rl_line', 'q') Time (h) rl/q/ds1 0.000000 0.000 0.016667 0.000 ... ... 2.983334 8.670 3.000000 8.391