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.
q
forflow
.The location can also be a filter string, e.g.
line
to extract the time-series values for all line geometry types. The following filters are available for theGPKGRL
class:None
: default - returns all available timespoint
:line
:polygon
: (orregion
)
The returned column names will be in the format
obj/data_type/location
e.g.po/flow/FC01.1_R
. Thedata_type
name in the column heading will be identical to the data type name passed into the function e.g. ifh
is 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
None
is 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
None
is passed in, all data types will be returned for the given locations.time_fmt (str, optional) – The format for the time column. Options are
relative
orabsolute
.
- 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