{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Snakes on a Plane (well, Planes in Python)\n", "\n", "This notebook explores a CSV files that contains the position, speeds and other\n", "related information for planes in the Boston area over a period of 6 hours.\n", "\n", "### About the data\n", "\n", "These data were collected by directly recording publicly available [Automatic\n", "dependent surveillance — broadcast\n", "(ADS–B)](https://en.wikipedia.org/wiki/Automatic_dependent_surveillance_%E2%80%93_broadcast)\n", "transmissions from planes from a single location (hence the data should not be considered complete). The data can be found in https://github.com/glue-viz/glue-example-data/tree/master/Planes/.\n", "\n", "For convenience we can use the ``require_data`` function to\n", "automatically download them here:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from glue_jupyter.data import require_data\n", "require_data('Planes/boston_planes_6h.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Starting up the glue Jupyter application" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start up glue:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import glue_jupyter as gj\n", "app = gj.jglue()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and load in the data:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "planes = app.load_data('boston_planes_6h.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can start off by making a 2D plot of the positions of the plane (the x/y values are in km offset):" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "scatter_viewer = app.scatter2d(x='x', y='y', data=planes)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's now make a histogram:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "histogram_viewer = app.histogram1d(x='vertical_rate', data=planes)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Try clicking on the **brush** tool and selecting some of the high values of vertical rate. These are planes taking off. Now check where these are in the 2D scatter plot.\n", "\n", "Let's have fun and take a look at what this looks like in 3D:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "scatter_3d_viewer = app.scatter3d(x='x', y='y', z='altitude', data=planes)" ] } ], "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.1" } }, "nbformat": 4, "nbformat_minor": 2 }