{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 9 - 2D & 3D movies\n", "\n", "### Topics\n", " 1. Intro to data & files\n", " 1. Brief review -- planet data\n", " 1. 2D Movies: Animations\n", " 1. 3D movies (with `ipyvolume`)\n", " * simple orbit plots\n", " * 3D animations\n", " * `ipyvolume` + `ipywidgets`\n", " * export your 3D animation to a webpage\n", " * Bonus: animation + widgets\n", "\n", "## Intro to data & files\n", "Let's make some movies!\n", "\n", "First, make sure you've downloaded **and unzipped** the zip file that stores the simulation data we are using today. Link to this file [is right here](https://github.com/jnaiman/csci-p-14110_su2020/raw/master/lesson09/data.zip). I recommend unzipping it \n", "\n", "This link was generated by running some simulations of a few of the planetary systems in the NASA exoplanet database. See the [Extra notebook in this lesson](extra_notebook_generate_sims.ipynb) for more details.\n", "\n", "We'll also make use of an additional library, [hermite_library.py](https://raw.githubusercontent.com/jnaiman/csci-p-14110_su2020/master/lesson09/hermite_library.py), to do some additional reading and writing of data, so make sure that is downloaded and in the same directory as this notebook file." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Brief review -- planet data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start by importing our usual things:" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import ipywidgets\n", "#%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Last time we did some info-viz type things with the planet dataset:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "planets = pd.read_csv('https://jnaiman.github.io/csci-p-14110_su2020/lesson08/planets_2020.06.22_10.10.17.csv', \n", " sep=\",\", comment=\"#\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | rowid | \n", "pl_hostname | \n", "pl_letter | \n", "pl_name | \n", "pl_discmethod | \n", "pl_controvflag | \n", "pl_pnum | \n", "pl_orbper | \n", "pl_orbpererr1 | \n", "pl_orbpererr2 | \n", "... | \n", "st_bmy | \n", "st_bmyerr | \n", "st_bmylim | \n", "st_m1 | \n", "st_m1err | \n", "st_m1lim | \n", "st_c1 | \n", "st_c1err | \n", "st_c1lim | \n", "st_colorn | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "11 Com | \n", "b | \n", "11 Com b | \n", "Radial Velocity | \n", "0 | \n", "1 | \n", "326.03000 | \n", "0.32 | \n", "-0.32 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "7.0 | \n", "
1 | \n", "2 | \n", "11 UMi | \n", "b | \n", "11 UMi b | \n", "Radial Velocity | \n", "0 | \n", "1 | \n", "516.21997 | \n", "3.20 | \n", "-3.20 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "5.0 | \n", "
2 | \n", "3 | \n", "14 And | \n", "b | \n", "14 And b | \n", "Radial Velocity | \n", "0 | \n", "1 | \n", "185.84000 | \n", "0.23 | \n", "-0.23 | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "7.0 | \n", "
3 | \n", "4 | \n", "14 Her | \n", "b | \n", "14 Her b | \n", "Radial Velocity | \n", "0 | \n", "1 | \n", "1773.40002 | \n", "2.50 | \n", "-2.50 | \n", "... | \n", "0.537 | \n", "0.001 | \n", "0.0 | \n", "0.366 | \n", "0.002 | \n", "0.0 | \n", "0.438 | \n", "0.006 | \n", "0.0 | \n", "9.0 | \n", "
4 | \n", "5 | \n", "16 Cyg B | \n", "b | \n", "16 Cyg B b | \n", "Radial Velocity | \n", "0 | \n", "1 | \n", "798.50000 | \n", "1.00 | \n", "-1.00 | \n", "... | \n", "0.418 | \n", "0.003 | \n", "0.0 | \n", "0.222 | \n", "0.003 | \n", "0.0 | \n", "0.351 | \n", "0.003 | \n", "0.0 | \n", "17.0 | \n", "
5 rows × 356 columns
\n", "