{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Run subset by (time) point operation\n", "\n", "**Rooki** calls climate data operations on the **rook** processing service.\n", "\n", "\n", "See issue: https://github.com/roocs/clisops/issues/230" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "#os.environ['ROOK_URL'] = 'http://rook.dkrz.de/wps'\n", "os.environ['ROOK_URL'] = 'http://compute.mips.copernicus-climate.eu/wps'\n", "#os.environ['ROOK_URL'] = 'http://rook3.cloud.dkrz.de/wps'\n", "\n", "from rooki import rooki" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## use workflow" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from rooki import operators as ops" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "wf = ops.Subset(\n", " ops.Input(\n", " 'tas', ['c3s-cmip6.CMIP.NCAR.CESM2-WACCM-FV2.historical.r1i1p1f1.Amon.tas.gn.v20191120']\n", " ),\n", " time=\"1998/2000\",\n", " #time_components=\"year:1998,1999,2000|month:jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec|day:01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\"\n", " time_components=\"year:1998,1999,2000|month:jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec|day:14,15\"\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "resp = wf.orchestrate()\n", "resp.ok" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading to /var/folders/qb/mg0csz190wd4rxybhhnwjln80000gn/T/metalink_7cr8bw2x/tas_Amon_CESM2-WACCM-FV2_historical_r1i1p1f1_gn_19980115-20001215.nc.\n" ] }, { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (time: 36, lat: 96, lon: 144, nbnd: 2)\n",
"Coordinates:\n",
" * lat (lat) float64 -90.0 -88.11 -86.21 -84.32 ... 86.21 88.11 90.0\n",
" * lon (lon) float64 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5\n",
" * time (time) object 1998-01-15 12:00:00 ... 2000-12-15 12:00:00\n",
"Dimensions without coordinates: nbnd\n",
"Data variables:\n",
" tas (time, lat, lon) float32 ...\n",
" time_bnds (time, nbnd) object 1998-01-01 00:00:00 ... 2001-01-01 00:00:00\n",
" lat_bnds (time, lat, nbnd) float64 -90.95 -89.05 -89.05 ... 89.05 90.95\n",
" lon_bnds (time, lon, nbnd) float64 -1.25 1.25 1.25 ... 356.2 356.2 358.8\n",
"Attributes: (12/45)\n",
" Conventions: CF-1.7 CMIP-6.2\n",
" activity_id: CMIP\n",
" branch_method: standard\n",
" branch_time_in_child: 674885.0\n",
" branch_time_in_parent: 10950.0\n",
" case_id: 1562\n",
" ... ...\n",
" sub_experiment_id: none\n",
" table_id: Amon\n",
" tracking_id: hdl:21.14100/2ebbfd9d-97bf-4858-b893-80d31ffe8cc7\n",
" variable_id: tas\n",
" variant_info: CMIP6 CESM2 historical ensemble with WACCM6-FV2 (...\n",
" variant_label: r1i1p1f1