#!/usr/bin/env python # coding: utf-8 # # Run average by time operation # # **Rooki** calls climate data operations on the **rook** processing service. # In[ ]: import os os.environ['ROOK_URL'] = 'http://rook.dkrz.de/wps' from rooki import rooki # **parameters of average operation** # In[ ]: get_ipython().run_line_magic('pinfo', 'rooki.average_time') # ## average by time # In[ ]: resp = rooki.average_time( collection='c3s-cmip6.ScenarioMIP.INM.INM-CM5-0.ssp245.r1i1p1f1.day.tas.gr1.v20190619', freq='year', ) resp.ok # In[ ]: #ds = resp.datasets()[0] #ds # In[ ]: from IPython.display import Image Image(resp.provenance_image()) # ## workflow: subset + average # # In[ ]: from rooki import operators as ops # In[ ]: tas = ops.Input( 'tas', ['c3s-cmip6.ScenarioMIP.INM.INM-CM5-0.ssp245.r1i1p1f1.day.tas.gr1.v20190619'] ) sub = ops.Subset(tas, time="2016/2017") wf = ops.AverageByTime(sub, freq="month") # In[ ]: resp = wf.orchestrate() resp.ok # In[ ]: ds = resp.datasets()[0] ds # In[ ]: from IPython.display import Image Image(resp.provenance_image())