{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Using WorldWide Telescope inside the Jupyter notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook shows how to start up the WorldWide Telescope Jupyter widget, and how to subsequently modify its properties. You can find out more about using pywwt in the [documentation](http://pywwt.readthedocs.io).\n", "\n", "We start off by importing the ``WWTJupyterWidget`` class:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pywwt.jupyter import WWTJupyterWidget" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We then use this class to create the widget (note that the second ``wwt`` is needed to actually show the contents of the widget):" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "wwt = WWTJupyterWidget()\n", "wwt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once the widget appears, you can then use the ``wwt`` object to change the visual settings, interact with WorldWide Telescope, and create annotations:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from astropy import units as u\n", "from astropy.coordinates import SkyCoord\n", "M31 = SkyCoord('00h42m44.330s +41d16m07.50s')\n", "wwt.center_on_coordinates(M31, fov=10 * u.deg)\n", "wwt.add_circle(M31, radius=1 * u.deg)\n", "wwt.constellation_figures = True" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can find out more about interacting with the ``wwt`` object in [Basic controls](http://pywwt.readthedocs.io/en/latest/settings.html) and [Showing annotations](http://pywwt.readthedocs.io/en/latest/annotations.html)." ] } ], "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.2" } }, "nbformat": 4, "nbformat_minor": 2 }