PointModelResult
modelskill.PointModelResult
Bases: TimeSeries
, Alignable
Construct a PointModelResult from a 0d data source: dfs0 file, mikeio.Dataset/DataArray, pandas.DataFrame/Series or xarray.Dataset/DataArray
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
(str, Path, Dataset, DataArray, DataFrame, Series, Dataset or DataArray)
|
filename (.dfs0 or .nc) or object with the data |
required |
name |
Optional[str]
|
The name of the model result, by default None (will be set to file name or item name) |
None
|
x |
float
|
first coordinate of point position, inferred from data if not given, else None |
None
|
y |
float
|
second coordinate of point position, inferred from data if not given, else None |
None
|
z |
float
|
third coordinate of point position, inferred from data if not given, else None |
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
|
quantity |
Quantity
|
Model quantity, for MIKE files this is inferred from the EUM information |
None
|
aux_items |
Optional[list[int | str]]
|
Auxiliary items, by default None |
None
|
Source code in modelskill/model/point.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
plot
instance-attribute
equals
interp_time
Interpolate model result to the time of the observation
wrapper around xarray.Dataset.interp()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
observation |
Observation
|
The observation to interpolate to |
required |
**kwargs |
Any
|
Additional keyword arguments passed to xarray.interp |
{}
|
Returns:
Type | Description |
---|---|
PointModelResult
|
Interpolated model result |
Source code in modelskill/model/point.py
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() |
{}
|