Observation and model data
import modelskill as ms
= ms.PointObservation('../data/SW/HKNA_Hm0.dfs0', item=0, x=4.2420, y=52.6887)
o = ms.PointModelResult('../data/SW/ts_storm_4.dfs0', item=0) # TODO coords mr
PointObservation
s and PointModelResult
s can be plotted using their plot
accessor:
The temporal coverage of observations and model results can be plotted using the temporal_coverage
function:
With a few observation and model result objects, the temporal coverage can be plotted:
The spatial coverage of observations and model results can be plotted using the spatial_overview
function:
The plot
accessor on a Comparer
or ComparerCollection
object can be used to plot the compared data:
<Comparer>
Quantity: Significant wave height [m]
Observation: HKNA_Hm0, n_points=386
Model(s):
0: HKZN_local_2017_DutchCoast
A Taylor diagram shows how well a model result matches an observation in terms of correlation, standard deviation and root mean squared error. The taylor
plot can be accessed through the Comparer plot
accessor or the ComparerCollection plot
accessor:
The radial distance from the point to the observation point is the standard deviation ratio, the angle is the correlation coefficient and the distance from the observation point to the model point is the root mean square error ratio. The closer the model point is to the observation point, the better the model result matches the observation. The closer the model point is to the origin, the better the model result matches the observation in terms of standard deviation and root mean square error. The closer the model point is to the horizontal axis, the better the model result matches the observation in terms of correlation.
Directional data can be plotted using the wind_rose
. The function takes an array-like structure with speed and direction as columns (from one or two sources) and plots a wind rose:
import mikeio
ds = mikeio.read("../data/wave_dir.dfs0")
df = ds[[0,2,1,3]].to_dataframe()
df.round(2).head()
China_Model: Sign. Wave Height | China_Model: Mean Wave Direction | China_Measured: Sign. Wave Height | China_Measured: Mean Wave Direction | |
---|---|---|---|---|
2006-12-20 22:00:00 | 0.30 | 320.58 | 0.25 | 330.39 |
2006-12-20 23:00:00 | 0.43 | 316.24 | 0.23 | 329.59 |
2006-12-21 00:00:00 | 0.38 | 316.11 | 0.20 | 321.02 |
2006-12-21 01:00:00 | 0.37 | 315.34 | 0.18 | 311.00 |
2006-12-21 02:00:00 | 0.41 | 313.36 | 0.18 | 300.78 |