{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Run workfow with subset chain\n", "\n", "**Rooki** calls climate data operations on the **rook** processing service." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## workflow with subset chain" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from rooki import operators as ops" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wf = ops.Subset(\n", " ops.Subset(\n", " ops.Input(\n", " 'tas', ['c3s-cmip5.output1.ICHEC.EC-EARTH.historical.day.atmos.day.r1i1p1.tas.latest']\n", " ),\n", " time=\"1860-01-01/1920-12-30\",\n", " ),\n", " time=\"1880-01-01/1900-12-30\",\n", ")\n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp = wf.orchestrate()\n", "resp" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**metalink output**" ] }, { "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": [ "**... and open with xarray**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds = resp.datasets()[0]\n", "ds" ] } ], "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }