#!/usr/bin/env python # coding: utf-8 # Simple notebook that shows how to create a comparer from scratch with Auxiliary date and filter # In[1]: import modelskill as ms import mikeio import numpy as np # In[2]: ds = mikeio.read('../tests/testdata/obs_two_items.dfs0') ds # First we create some random data for this example # In[3]: df = ds.to_dataframe() df['Temperature'] = df['Temperature'] + np.random.random(size=len(df)) df['Waves'] = df['Temperature'] + np.random.random(size=len(df)) df['Water Level'] = df['Temperature'] + np.random.random(size=len(df)) df.head() # In[4]: df.plot(); # Now we make modelskill obs and mod objects # In[5]: obs = ms.PointObservation(df, item='Temperature', aux_items='Waves', name='P1') mod = ms.PointModelResult(df, item='Water Level', name='Mod1') # First we compare all data, and get ~50k points # In[6]: cmp=ms.match(obs, mod) cmp # In[7]: cmp.plot.scatter(show_points=True, skill_table=True); # Now we filter the comparer based on auxiliary data and get ~10k points # In[8]: (cmp .where(cmp.data['Waves']>4.5) .plot.scatter(show_points=True, skill_table=True) );