Skip to content

Commit

Permalink
Merge pull request #89 from roocs/add-nb-cmip6-decadal
Browse files Browse the repository at this point in the history
added notebook for cmip6 decadal
  • Loading branch information
cehbrecht committed Dec 16, 2021
2 parents 036465b + b86b881 commit 09dd4b0
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions notebooks/demo/demo-rooki-cmip6-decadal.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Examples for cmip6 decadal\n",
"\n",
"**Rooki** calls climate data operations on the **rook** processing service."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.environ['ROOK_URL'] = 'http://rook.dkrz.de/wps'\n",
"\n",
"from rooki import operators as ops"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run subset"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"wf = ops.Subset(\n",
" ops.Input(\n",
" # 'tas', ['c3s-cmip6.DCPP.CMCC.CMCC-CM2-SR5.dcppA-hindcast.s2005-r10i1p1f1.Amon.tas.gn.v20210719']\n",
" 'tas', ['cmip6.DCPP.CMCC.CMCC-CM2-SR5.dcppA-hindcast.s2005-r10i1p1f1.Amon.tas.gn.v20210719']\n",
" ),\n",
" time=\"2010-01-01/2010-12-30\",\n",
")\n",
"\n",
"resp = wf.orchestrate()\n",
"resp.ok"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**open with xarray**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dsets = resp.datasets()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds = dsets[0]\n",
"ds"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**provenance**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"prov_plot_url = resp.provenance_image()\n",
"prov_plot_url"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Image\n",
"Image(prov_plot_url)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit 09dd4b0

Please sign in to comment.