diff --git a/docs/source/conf.py b/docs/source/conf.py index 44abbbc..ae227af 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -108,11 +108,6 @@ "_build", "Thumbs.db", ".DS_Store", - # Undocumented notebooks - "notebooks/examples/owslib-esgfwps.ipynb", - "notebooks/examples/rook-demo.ipynb", - "notebooks/examples/twitcher-c3s-magic-demo.ipynb", - "notebooks/examples/twitcher-magic-cexp-demo.ipynb", ] # The reST default role (used for this markup: `text`) to use for all diff --git a/notebooks/examples/owslib-esgfwps.ipynb b/notebooks/examples/owslib-esgfwps.ipynb deleted file mode 100644 index 0493643..0000000 --- a/notebooks/examples/owslib-esgfwps.ipynb +++ /dev/null @@ -1,129 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Birdy\n", - "\n", - "\n", - "Birdy offers through its `WPSClient` class a simplified interface to WPS processes, but it does not yet support the CWT-API extension (see [issue 102](https://github.com/bird-house/birdy/issues/102)). \n", - "Look at the [doc](https://birdy.readthedocs.io/en/latest/) for more info. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from birdy import WPSClient\n", - "\n", - "wps = WPSClient(\"https://bovec.dkrz.de/ows/proxy/pelican\")\n", - "# wps = WPSClient('http://localhost:5000/wps')\n", - "help(wps.pelican_subset)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from owslib_esgfwps import Dimension, Domain, Variable" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# data files we want to process\n", - "files = [\n", - " # OpenDAP, CORDEX EUR-44, tasmax, climate index SU (summer days)\n", - " \"http://opendap.knmi.nl/knmi/thredds/dodsC/CLIPC/gerics/climatesignalmaps/EUR-44/tasmax/su_python-2-7-6_GERICS_ens-multiModel-climatesignalmap-rcp85-EUR-44_yr_20700101-20991231_1971-2000.nc\",\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "su = Variable(uri=files[0], var_name=\"su\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "domain = Domain(\n", - " {\"time\": Dimension(0, 1, crs=\"indices\")},\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from owslib_esgfwps import Domains, Variables\n", - "\n", - "resp = wps.pelican_subset(variable=Variables([su]), domain=Domains([domain]))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "resp.get(asobj=False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "out = resp.get(asobj=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "out.preview" - ] - } - ], - "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.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/notebooks/examples/rook-demo.ipynb b/notebooks/examples/rook-demo.ipynb deleted file mode 100644 index 776c994..0000000 --- a/notebooks/examples/rook-demo.ipynb +++ /dev/null @@ -1,100 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Use Birdy to access ROOK WPS\n", - "https://github.com/roocs/rook" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from birdy import WPSClient\n", - "\n", - "url = \"http://rook.dkrz.de/wps\"\n", - "rook = WPSClient(url, progress=True, lineage=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Available processes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "rook?" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run subset" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "rook.subset?" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "resp = rook.subset(\n", - " collection=\"c3s-cmip6.ScenarioMIP.NIMS-KMA.KACE-1-0-G.ssp245.r1i1p1f1.Amon.tas.gr.v20191217\",\n", - " time=\"2021-01-01/2021-12-30\",\n", - " area=\"-10,30,35,70\",\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ds = resp.get(\"output\")[0][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.9.2" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/notebooks/examples/twitcher-c3s-magic-demo.ipynb b/notebooks/examples/twitcher-c3s-magic-demo.ipynb deleted file mode 100644 index 264bf53..0000000 --- a/notebooks/examples/twitcher-c3s-magic-demo.ipynb +++ /dev/null @@ -1,234 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from birdy import WPSClient" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "magic = WPSClient(\n", - " \"https://cp4cds-cn2.dkrz.de/ows/proxy/magic_demo\"\n", - ") # verify=False # progress=True" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Rainfarm" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "help(magic.rainfarm)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result = magic.rainfarm()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(result.getStatus())\n", - "print(result.statusMessage)\n", - "print(result.percentCompleted)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get().success" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Run consecdrydays" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result = magic.consecdrydays()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(result.getStatus())\n", - "print(result.statusMessage)\n", - "print(result.percentCompleted)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get().success" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Weather Regimes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result = magic.weather_regimes()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(result.getStatus())\n", - "print(result.statusMessage)\n", - "print(result.percentCompleted)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get().success" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Modes of Variability" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result = magic.modes_of_variability()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(result.getStatus())\n", - "print(result.statusMessage)\n", - "print(result.percentCompleted)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "result.get().success" - ] - } - ], - "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.6.9" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/notebooks/examples/twitcher-magic-cexp-demo.ipynb b/notebooks/examples/twitcher-magic-cexp-demo.ipynb deleted file mode 100644 index 7539e51..0000000 --- a/notebooks/examples/twitcher-magic-cexp-demo.ipynb +++ /dev/null @@ -1,138 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from birdy import WPSClient" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Get an access token" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "client_id = \"7e09d5e948fd48c69418230b5f648a12\"\n", - "client_secret = \"46bf8197254f4816b68b6ba7412f1182\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import requests\n", - "\n", - "url = \"https://cp4cds-cn2.dkrz.de/oauth/token?grant_type=client_credentials&client_id={}&client_secret={}\"\n", - "token = requests.get(url.format(client_id, client_secret), verify=False)\n", - "token = token.json()\n", - "token" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Init WPS for climate explorer" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "headers = {\"Authorization\": \"Bearer {}\".format(token[\"access_token\"])}\n", - "\n", - "cexp = WPSClient(\n", - " \"https://cp4cds-cn2.dkrz.de/ows/proxy/cexp\",\n", - " progress=True,\n", - " verify=False,\n", - " headers=headers,\n", - ")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Run process" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "help(cexp.correlate_field)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "response = cexp.correlate_field()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "response.getStatus()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "response.get()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "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.6.9" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}