{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import geoviews as gv\n", "import geoviews.feature as gf\n", "import xarray as xr\n", "from cartopy import crs\n", "\n", "gv.extension('bokeh')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ensemble = xr.open_dataset('../../data/ensemble.nc')\n", "dataset = gv.Dataset(ensemble, ['longitude', 'latitude', 'time'], 'surface_temperature', crs=crs.PlateCarree())\n", "images = dataset.to(gv.Image)\n", "# Equivalent full definition:\n", "# images = dataset.to(gv.Image, ['longitude', 'latitude'], 'surface_temperature', 'time')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "images.opts(cmap='viridis', colorbar=True, width=600, height=500) * gf.coastline" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }