{ "cells": [ { "cell_type": "markdown", "id": "careful-exchange", "metadata": {}, "source": [ "# Test: Workflow subset+average SAM0-UNICON/historical\n", "\n", "* Project: c3s-cmip6\n", "* Variable: pr\n", "* Frequency: day\n", "* *Complete* files" ] }, { "cell_type": "code", "execution_count": null, "id": "available-invite", "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": "code", "execution_count": null, "id": "prepared-monitoring", "metadata": {}, "outputs": [], "source": [ "sub = ops.Subset(\n", " ops.Input(\n", " 'cmip6', ['c3s-cmip6.CMIP.SNU.SAM0-UNICON.historical.r1i1p1f1.day.pr.gn.v20190323']\n", " ),\n", " time=\"1860-01-01/1860-12-31\",\n", " original_files=\"1\"\n", ")\n", "wf = ops.Average(sub, dims=\"time\")\n", " " ] }, { "cell_type": "code", "execution_count": null, "id": "pregnant-collection", "metadata": {}, "outputs": [], "source": [ "resp = wf.orchestrate()\n", "assert resp.ok" ] }, { "cell_type": "code", "execution_count": null, "id": "civilian-examination", "metadata": {}, "outputs": [], "source": [ "resp.download_urls()" ] }, { "cell_type": "code", "execution_count": null, "id": "destroyed-joshua", "metadata": {}, "outputs": [], "source": [ "assert 'pr_day_SAM0-UNICON_historical_r1i1p1f1_gn_avg-t.nc' in resp.download_urls()[0]\n" ] }, { "cell_type": "code", "execution_count": null, "id": "comparable-congo", "metadata": {}, "outputs": [], "source": [ "assert resp.num_files == 1, resp.num_files" ] }, { "cell_type": "code", "execution_count": null, "id": "unauthorized-baking", "metadata": {}, "outputs": [], "source": [ "# TODO: file size needs fix ... new catalog\n", "assert int(resp.size) == 258894, resp.size" ] }, { "cell_type": "markdown", "id": "objective-director", "metadata": {}, "source": [ "Provenance: \n", "* expected duration=1 sec" ] }, { "cell_type": "code", "execution_count": null, "id": "varied-problem", "metadata": {}, "outputs": [], "source": [ "resp.provenance()" ] } ], "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": 5 }