{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "
\n", "\n", "
\n", "\"Unidata\n", "
\n", " \n", "![under construction](https://images2.minutemediacdn.com/image/upload/c_fit,f_auto,fl_lossy,q_auto,w_728/v1555999902/shape/mentalfloss/under_construction1_0.gif?itok=Pn9g_wu6)\n", " \n", "

xarray: Calculations

\n", "

Unidata AMS 2021 Student Conference

\n", "\n", "
\n", "
\n", "\n", "---\n", "\n", "Using [xarray](http://xarray.pydata.org/en/stable/), you can perform many of the same calculations as you would with a basic NumPy array, but with the added benefit of name-based rather than position-based dimensions/axes as well as label-based lookups. In this notebook, we'll be demonstrating several of these types of calculations (except for a specific subset of calculations, called aggregations, which combine data together using some summary statistic...these get [their own training notebook](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/analysis/xarray_aggregations.ipynb)).\n", "\n", "For a full overview of xarray calculations, see [the relevant page in xarray's documentation](http://xarray.pydata.org/en/stable/computation.html).\n", "\n", "
\"HTML
\n", "\n", "\n", "### Focuses\n", "\n", "- Show how ufuncs work smoothly on xarray data\n", "- Demonstrate pandas-like missing data calculations\n", "- Learn artithmetic operations take care of dimension broadcasting automatically\n", "- Learn how to wrap custom computations\n", "- Demonstrate using calculations from an external library (xskillscore, for verification statistics)\n", "\n", "### Objectives\n", "\n", "1. [...](#1.-Access-local-NetCDF-data)\n", "1. [...](#2.-Access-remote-OPENDAP-data)\n", "1. [...](#3.-Access-local-GRIB-data)\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Imports" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import xarray as xr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Section 1\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "..." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Top\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Section 2\n", "\n", "..." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Top\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Section 3\n", "\n", "..." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "Top\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## See also\n", "\n", "There's a lot more to xarray than just calculations! Be sure to take a look at the other xarray training notebooks linked below:\n", "\n", "- [Xarray data access](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/dataAccess/xarray_data_access.ipynb)\n", "- [Indexing with xarray](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/analysis/xarray_indexing.ipynb)\n", "- [Interpolation and regridding with xarray](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/analysis/xarray_interpolation.ipynb)\n", "- [Xarray aggregation operations](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/analysis/xarray_aggregations.ipynb)\n", "- [MetPy with xarray](https://nbviewer.jupyter.org/github/Unidata/pyaos-ams-2021/blob/master/notebooks/analysis/metpy_and_xarray.ipynb)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Top\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:pyaos-ams-2021]", "language": "python", "name": "conda-env-pyaos-ams-2021-py" }, "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.1" } }, "nbformat": 4, "nbformat_minor": 4 }