{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Run subset by area 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 subset operation**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "rooki.subset?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**run subset by area**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp = rooki.subset(\n", " collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',\n", " time='1860-01-01/1980-12-30',\n", " area='0.,49.,10.,65'\n", ")\n", "resp.ok" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**show metalink output**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp.url" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(resp.xml)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Size in MBytes**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp.size_in_mb" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**URLs in metalink document ...**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp.download_urls()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**download files ...**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp.download()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**... and 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": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.attrs" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.2" } }, "nbformat": 4, "nbformat_minor": 4 }