{ "cells": [ { "cell_type": "markdown", "id": "incorporate-uruguay", "metadata": {}, "source": [ "# Test: subset SAM0-UNICON/historical\n", "\n", "* Project: c3s-cmip6\n", "* Variable: pr\n", "* Frequency: day\n", "* *Complete* files" ] }, { "cell_type": "code", "execution_count": null, "id": "educated-collins", "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": "signed-navigation", "metadata": {}, "outputs": [], "source": [ "wf = ops.Subset(\n", " ops.Input(\n", " 'cmip6', ['c3s-cmip6.CMIP.SNU.SAM0-UNICON.historical.r1i1p1f1.day.pr.gn.v20190323']\n", " ),\n", ")\n", " " ] }, { "cell_type": "code", "execution_count": null, "id": "important-chuck", "metadata": {}, "outputs": [], "source": [ "resp = wf.orchestrate()\n", "assert resp.ok" ] }, { "cell_type": "code", "execution_count": null, "id": "increased-dover", "metadata": {}, "outputs": [], "source": [ "resp.download_urls()" ] }, { "cell_type": "code", "execution_count": null, "id": "strong-franklin", "metadata": {}, "outputs": [], "source": [ "assert 'https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cmip6' in resp.download_urls()[0]\n", "assert 'pr_day_SAM0-UNICON_historical_r1i1p1f1_gn_18500101-18501231.nc' in resp.download_urls()[0]\n" ] }, { "cell_type": "code", "execution_count": null, "id": "durable-chrome", "metadata": {}, "outputs": [], "source": [ "assert 'https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cmip6' in resp.download_urls()[0]" ] }, { "cell_type": "code", "execution_count": null, "id": "under-metro", "metadata": {}, "outputs": [], "source": [ "assert resp.num_files == 165, resp.num_files" ] }, { "cell_type": "code", "execution_count": null, "id": "polished-memorabilia", "metadata": {}, "outputs": [], "source": [ "# TODO: file size needs fix ... new catalog\n", "assert int(resp.size_in_mb) == 0, resp.size_in_mb" ] }, { "cell_type": "markdown", "id": "critical-property", "metadata": {}, "source": [ "Provenance: \n", "* expected duration=1 sec" ] }, { "cell_type": "code", "execution_count": null, "id": "unknown-winning", "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 }