TrackModelResult
modelskill.TrackModelResult
Bases: TimeSeries
, Alignable
Construct a TrackModelResult from a dfs0 file, mikeio.Dataset, pandas.DataFrame or a xarray.Datasets
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
TrackType
|
The input data or file path |
required |
name |
Optional[str]
|
The name of the model result, by default None (will be set to file name or item name) |
None
|
item |
str | int | None
|
If multiple items/arrays are present in the input an item must be given (as either an index or a string), by default None |
None
|
x_item |
str | int | None
|
Item of the first coordinate of positions, by default None |
0
|
y_item |
str | int | None
|
Item of the second coordinate of positions, by default None |
1
|
quantity |
Quantity
|
Model quantity, for MIKE files this is inferred from the EUM information |
None
|
keep_duplicates |
(str, bool)
|
Strategy for handling duplicate timestamps (wraps xarray.Dataset.drop_duplicates) "first" to keep first occurrence, "last" to keep last occurrence, False to drop all duplicates, "offset" to add milliseconds to consecutive duplicates, by default "first" |
'first'
|
aux_items |
Optional[list[int | str]]
|
Auxiliary items, by default None |
None
|
Source code in modelskill/model/track.py
plot
instance-attribute
equals
sel
to_dataframe
Convert matched data to pandas DataFrame
Include x, y coordinates only if gtype=track
Returns:
Type | Description |
---|---|
DataFrame
|
data as a pandas DataFrame |
Source code in modelskill/timeseries/_timeseries.py
trim
Trim observation data to a given time interval
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_time |
Timestamp
|
start time |
None
|
end_time |
Timestamp
|
end time |
None
|
buffer |
str
|
buffer time around start and end time, by default "1s" |
'1s'
|
Source code in modelskill/timeseries/_timeseries.py
modelskill.timeseries._plotter.MatplotlibTimeSeriesPlotter
Bases: TimeSeriesPlotter
Source code in modelskill/timeseries/_plotter.py
hist
Plot histogram of timeseries values
Wraps pandas.DataFrame hist() method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bins |
int
|
specification of bins, by default 100 |
100
|
title |
str
|
plot title, default: observation name |
None
|
color |
str
|
plot color, by default "#d62728" |
None
|
**kwargs |
other keyword arguments to df.hist() |
{}
|
Returns:
Type | Description |
---|---|
matplotlib axes
|
|
Source code in modelskill/timeseries/_plotter.py
timeseries
Plot timeseries
Wraps pandas.DataFrame plot() method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
plot title, default: [name] |
None
|
color |
str
|
plot color, by default '#d62728' |
None
|
marker |
str
|
plot marker, by default '.' |
'.'
|
linestyle |
str
|
line style, by default None |
'None'
|
**kwargs |
other keyword arguments to df.plot() |
{}
|