Skip to content

Commit

Permalink
update regrid nb
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Nov 17, 2023
1 parent 7d8f73c commit aec21a2
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 717 deletions.
132 changes: 132 additions & 0 deletions notebooks/demo/demo-rooki-regrid-cmip6.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Run regrid operation\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 rooki"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**parameters of regrid operation**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"rooki.regrid?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## workflow: subset + regrid\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rooki import operators as ops"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"rlds = ops.Input(\n",
" 'rlds', ['c3s-cmip6.ScenarioMIP.INM.INM-CM5-0.ssp245.r1i1p1f1.Amon.rlds.gr1.v20190619']\n",
")\n",
"\n",
"wf = ops.Subset(rlds, time=\"2016/2016\")\n",
"\n",
"wf = ops.Regrid(wf, method=\"nearest_s2d\", grid=\"1deg\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"resp = wf.orchestrate()\n",
"resp.ok "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"resp.status"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds = resp.datasets()[0]\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Image\n",
"Image(resp.provenance_image())"
]
}
],
"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.12.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
717 changes: 0 additions & 717 deletions notebooks/demo/demo-rooki-regrid.ipynb

This file was deleted.

0 comments on commit aec21a2

Please sign in to comment.