#!/usr/bin/env python # coding: utf-8 # # Combine comparers # FMskill comparers can be combined by using the "+" operator. You may want to add a new ModelResult to your existing comparison or a new observation or a new time period: # # cc = cc1 + cc2 # In[1]: from fmskill import ModelResult, PointObservation, TrackObservation, Connector get_ipython().run_line_magic('matplotlib', 'inline') # ## Observations # In[2]: o1 = PointObservation('../tests/testdata/SW/HKNA_Hm0.dfs0', item=0, x=4.2420, y=52.6887, name="HKNA") o2 = PointObservation("../tests/testdata/SW/eur_Hm0.dfs0", item=0, x=3.2760, y=51.9990, name="EPL") o3 = TrackObservation("../tests/testdata/SW/Alti_c2_Dutch.dfs0", item=3, name="c2") # ## Model Results # In[3]: fn = "../tests/testdata/SW/CMEMS_DutchCoast_*.nc" mr1 = ModelResult(fn, name='CMEMS', item='VHM0') mr1 # In[4]: mr2 = ModelResult('../tests/testdata/SW/HKZN_local_2017_DutchCoast.dfsu', name='MIKE21SW', item=0) # ## Connect and extract # Notice that the two ModelResults doesn't cover the exact same period. # In[5]: con1 = Connector([o1,o2,o3],mr1) con2 = Connector([o1,o2,o3],mr2) con1.plot_temporal_coverage(limit_to_model_period=False) con2.plot_temporal_coverage(limit_to_model_period=False); # In[6]: cc1 = con1.extract() cc2 = con2.extract() # In[7]: cc1.skill() # In[8]: cc2.skill() # ## Add the two Comparers # In[9]: cc = cc1 + cc2 # In[10]: cc.skill() # In[ ]: