Go to file
2020-11-16 10:18:37 -05:00
2020-11-04 10:02:44 -05:00
2020-11-04 10:02:44 -05:00
2020-11-16 10:18:37 -05:00
2020-11-04 10:02:44 -05:00
2020-11-04 10:02:44 -05:00
2020-11-04 10:02:44 -05:00
2020-11-04 10:02:44 -05:00
2020-11-13 19:31:58 -05:00
2020-11-16 10:18:37 -05:00
2020-11-16 10:18:37 -05:00
2020-11-16 10:18:37 -05:00
2020-11-16 10:18:37 -05:00
2020-11-16 10:18:37 -05:00
2020-11-16 10:18:37 -05:00
2020-11-04 10:02:44 -05:00
2020-11-13 11:46:00 -05:00
2020-11-13 11:46:00 -05:00
2020-11-13 11:46:00 -05:00
2020-11-16 10:18:37 -05:00
2020-11-13 11:46:00 -05:00
2020-11-04 10:02:44 -05:00
2020-11-16 10:18:37 -05:00
2020-11-13 11:46:00 -05:00

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Astronomical Data in Python &#8212; Astronomical Data in Python</title>
    
  <link rel="stylesheet" href="_static/css/index.d431a4ee1c1efae0e38bdfebc22debff.css">

    
  <link rel="stylesheet"
    href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">

    
      
  <link rel="stylesheet"
    href="_static/vendor/open-sans_all/1.44.1/index.css">
  <link rel="stylesheet"
    href="_static/vendor/lato_latin-ext/1.44.1/index.css">

    
    <link rel="stylesheet" href="_static/sphinx-book-theme.bfb7730f9caf2ec0b46a44615585038c.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
    <link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
    <link rel="stylesheet" type="text/css" href="_static/mystnb.css" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
    <link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
    <link rel="stylesheet" type="text/css" href="_static/panels-variables.06eb56fa6e07937060861dad626602ad.css" />
    
  <link rel="preload" as="script" href="_static/js/index.30270b6e4c972e43c488.js">

    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <script src="_static/togglebutton.js"></script>
    <script src="_static/clipboard.min.js"></script>
    <script src="_static/copybutton.js"></script>
    <script >var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script>
    <script src="_static/sphinx-book-theme.be0a4a0c39cd630af62a2fcf693f3f06.js"></script>
    <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]], "processRefs": false, "processEnvironments": false}})</script>
    <script async="async" src="https://unpkg.com/thebelab@latest/lib/index.js"></script>
    <script >
        const thebe_selector = ".thebe"
        const thebe_selector_input = "pre"
        const thebe_selector_output = ".output"
    </script>
    <script async="async" src="_static/sphinx-thebe.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Chapter 1" href="01_query.html" />

    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="docsearch:language" content="en" />



  </head>
  <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
    

    <div class="container-xl">
      <div class="row">
          
<div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation">
    
        <div class="navbar-brand-box">
<a class="navbar-brand text-wrap" href="index.html">
  
  
  <h1 class="site-logo" id="site-title">Astronomical Data in Python</h1>
  
</a>
</div>

<form class="bd-search d-flex align-items-center" action="search.html" method="get">
  <i class="icon fas fa-search"></i>
  <input type="search" class="form-control" name="q" id="search-input" placeholder="Search this book..." aria-label="Search this book..." autocomplete="off" >
</form>

<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
  <ul class="nav sidenav_l1">
 <li class="toctree-l1">
  <a class="reference internal" href="#">
   Astronomical Data in Python
  </a>
 </li>
</ul>
<ul class="nav sidenav_l1">
 <li class="toctree-l1">
  <a class="reference internal" href="01_query.html">
   Chapter 1
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="02_coords.html">
   Chapter 2
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="03_motion.html">
   Chapter 3
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="04_select.html">
   Chapter 4
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="05_join.html">
   Chapter 5
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="06_photo.html">
   Chapter 6
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="07_plot.html">
   Chapter 7
  </a>
 </li>
</ul>

</nav>

 <!-- To handle the deprecated key -->

<div class="navbar_extra_footer">
  Powered by <a href="https://jupyterbook.org">Jupyter Book</a>
</div>

</div>


          


          
<main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main">
    
    <div class="row topbar fixed-top container-xl">
    <div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show">
    </div>
    <div class="col pl-2 topbar-main">
        
        <button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse"
            data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu"
            aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation"
            title="Toggle navigation" data-toggle="tooltip" data-placement="left">
            <i class="fas fa-bars"></i>
            <i class="fas fa-arrow-left"></i>
            <i class="fas fa-arrow-up"></i>
        </button>
        
        <div class="dropdown-buttons-trigger">
    <button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Download this page"><i
            class="fas fa-download"></i></button>

    
    <div class="dropdown-buttons">
        <!-- ipynb file if we had a myst markdown file -->
        
        <!-- Download raw file -->
        <a class="dropdown-buttons" href="_sources/README.md"><button type="button"
                class="btn btn-secondary topbarbtn" title="Download source file" data-toggle="tooltip"
                data-placement="left">.md</button></a>
        <!-- Download PDF via print -->
        <button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
            onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
    </div>
    
</div>
        <!-- Source interaction buttons -->

<div class="dropdown-buttons-trigger">
    <button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn"
        aria-label="Connect with source repository"><i class="fab fa-github"></i></button>
    <div class="dropdown-buttons sourcebuttons">
        <a class="repository-button"
            href="https://github.com/AllenDowney/AstronomyDataPython"><button type="button" class="btn btn-secondary topbarbtn"
                data-toggle="tooltip" data-placement="left" title="Source repository"><i
                    class="fab fa-github"></i>repository</button></a>
        
        
    </div>
</div>


        <!-- Full screen (wrap in <a> to have style consistency -->
        <a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip"
                data-placement="bottom" onclick="toggleFullScreen()" title="Fullscreen mode"><i
                    class="fas fa-expand"></i></button></a>

        <!-- Launch buttons -->

    </div>

    <!-- Table of contents -->
    <div class="d-none d-md-block col-md-2 bd-toc show">
        
    </div>
</div>
    <div id="main-content" class="row">
        <div class="col-12 col-md-9 pl-md-3 pr-md-0">
        
              <div>
                
  <div class="section" id="astronomical-data-in-python">
<h1>Astronomical Data in Python<a class="headerlink" href="#astronomical-data-in-python" title="Permalink to this headline">¶</a></h1>
<p><em>Astronomical Data in Python</em> is an introduction to tools and practices for working with astronomical data.  Topics covered include:</p>
<ul class="simple">
<li><p>Writing queries that select and download data from a database.</p></li>
<li><p>Using data stored in an Astropy <code class="docutils literal notranslate"><span class="pre">Table</span></code> or Pandas <code class="docutils literal notranslate"><span class="pre">DataFrame</span></code>.</p></li>
<li><p>Working with coordinates and other quantities with units.</p></li>
<li><p>Storing data in various formats.</p></li>
<li><p>Performing database join operations that combine data from multiple tables.</p></li>
<li><p>Visualizing data and preparing publication-quality figures.</p></li>
</ul>
<p>As a running example, we will replicate part of the analysis in a recent paper, “<a class="reference external" href="https://arxiv.org/abs/1805.00425">Off the beaten path: Gaia reveals GD-1 stars outside of the main stream</a>” by Adrian M. Price-Whelan and Ana Bonaca.</p>
<p>This material was developed in collaboration with <a class="reference external" href="https://carpentries.org/">The Carpentries</a> and the Astronomy Curriculum Development Committee, and supported by funding from the American Institute of Physics through the American Astronomical Society.</p>
<p>I am grateful for contributions from the members of the committee  Azalee Bostroem, Rodolfo Montez, and Phil Rosenfield  and from Erin Becker, Brett Morris and Adrian Price-Whelan.</p>
<p>The original format of this material is a series of Jupyter notebooks.  Using the
links below, you can read the notebooks on NBViewer or run them on Colab.  If you
want to run the notebooks in your own environment, you can download them from
this repository and follow the instructions below to set up your environment.</p>
<p>This material is also available in the form of <a class="reference external" href="https://datacarpentry.github.io/astronomy-python">Carpentries lessons</a>, but you should be
aware that these versions might diverge in the future.</p>
<p><strong>Prerequisites</strong></p>
<p>This material should be accessible to people familiar with basic Python, but not necessarily the libraries we will use, like Astropy or Pandas.  If you are familiar with Python lists and dictionaries, and you know how to write a function that takes parameters and returns a value, that should be enough.</p>
<p>We assume that you are familiar with astronomy at the undergraduate level, but we will not assume specialized knowledge of the datasets or analysis methods well use.</p>
<p><strong>Notebook 1</strong></p>
<p>This notebook demonstrates the following steps:</p>
<ol class="simple">
<li><p>Making a connection to the Gaia server,</p></li>
<li><p>Exploring information about the database and the tables it contains,</p></li>
<li><p>Writing a query and sending it to the server, and finally</p></li>
<li><p>Downloading the response from the server as an Astropy <code class="docutils literal notranslate"><span class="pre">Table</span></code>.</p></li>
</ol>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/01_query.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/01_query.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 2</strong></p>
<p>This notebook starts with an example that does a “cone search”; that is, it selects stars that appear in a circular region of the sky.</p>
<p>Then, to select stars in the vicinity of GD-1, we:</p>
<ul class="simple">
<li><p>Use <code class="docutils literal notranslate"><span class="pre">Quantity</span></code> objects to represent measurements with units.</p></li>
<li><p>Use the <code class="docutils literal notranslate"><span class="pre">Gala</span></code> library to convert coordinates from one frame to another.</p></li>
<li><p>Use the ADQL keywords <code class="docutils literal notranslate"><span class="pre">POLYGON</span></code>, <code class="docutils literal notranslate"><span class="pre">CONTAINS</span></code>, and <code class="docutils literal notranslate"><span class="pre">POINT</span></code> to select stars that fall within a polygonal region.</p></li>
<li><p>Submit a query and download the results.</p></li>
<li><p>Store the results in a FITS file.</p></li>
</ul>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/02_coords.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/02_coords.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 3</strong></p>
<p>Here are the steps in this notebook:</p>
<ol class="simple">
<li><p>Well read back the results from the previous notebook, which we saved in a FITS file.</p></li>
<li><p>Then well transform the coordinates and proper motion data from ICRS back to the coordinate frame of GD-1.</p></li>
<li><p>Well put those results into a Pandas <code class="docutils literal notranslate"><span class="pre">DataFrame</span></code>, which well use to select stars near the centerline of GD-1.</p></li>
<li><p>Plotting the proper motion of those stars, well identify a region of proper motion for stars that are likely to be in GD-1.</p></li>
<li><p>Finally, well select and plot the stars whose proper motion is in that region.</p></li>
</ol>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/03_motion.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/03_motion.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 4</strong></p>
<p>Here are the steps in this notebook:</p>
<ol class="simple">
<li><p>Using data from the previous notebook, well identify the values of proper motion for stars likely to be in GD-1.</p></li>
<li><p>Then well compose an ADQL query that selects stars based on proper motion, so we can download only the data we need.</p></li>
<li><p>Well also see how to write the results to a CSV file.</p></li>
</ol>
<p>That will make it possible to search a bigger region of the sky in a single query.</p>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/04_select.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/04_select.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 5</strong></p>
<p>Here are the steps in this notebook:</p>
<ol class="simple">
<li><p>Well reload the candidate stars we identified in the previous notebook.</p></li>
<li><p>Then well run a query on the Gaia server that uploads the table of candidates and uses a <code class="docutils literal notranslate"><span class="pre">JOIN</span></code> operation to select photometry data for the candidate stars.</p></li>
<li><p>Well write the results to a file for use in the next notebook.</p></li>
</ol>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/05_join.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/05_join.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 6</strong></p>
<p>Here are the steps in this notebook:</p>
<ol class="simple">
<li><p>Well reload the data from the previous notebook and make a color-magnitude diagram.</p></li>
<li><p>Then well specify a polygon in the diagram that contains stars with the photometry we expect.</p></li>
<li><p>Then well merge the photometry data with the list of candidate stars, storing the result in a Pandas <code class="docutils literal notranslate"><span class="pre">DataFrame</span></code>.</p></li>
</ol>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/06_photo.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/06_photo.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Notebook 7</strong></p>
<p>Here are the steps in this notebook:</p>
<ol class="simple">
<li><p>Starting with the figure from the previous notebook, well add annotations to present the results more clearly.</p></li>
<li><p>The well see several ways to customize figures to make them more appealing and effective.</p></li>
<li><p>Finally, well see how to make a figure with multiple panels or subplots.</p></li>
</ol>
<p>Press this button to run this notebook on Colab:</p>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/AstronomicalData/blob/main/07_plot.ipynb"><img src="run_on_colab_small.png"></a></p>
<p><a class="reference external" href="https://nbviewer.jupyter.org/github/AllenDowney/AstronomicalData/blob/main/07_plot.ipynb">or click here to read it on NBViewer</a></p>
<p><strong>Installation instructions</strong></p>
<p>If you plan to run these notebooks on Colab, you dont have to install anything; you can use the links in the
previous section to open and run them.
If you want to run the notebooks in your own environment, you might have to do some setup.</p>
<p>You will need to install Python, Jupyter, and some additional libraries.
If you dont already have Jupyter, we recommend installing Anaconda, which is a Python distribution that
contains everything you need to run the workshop code.  It is easy to install on Windows, Mac, and Linux,
and because it does a user-level install, it will not interfere with other Python installations.</p>
<p><a class="reference external" href="https://www.anaconda.com/distribution/">Information about installing Anaconda is here</a>.</p>
<p>If you have the choice of Python 2 or 3, choose Python 3.</p>
<p>Now, there are two ways to get the libraries you need:</p>
<ul class="simple">
<li><p>Option 1: You can install them in an existing Conda environment.</p></li>
<li><p>Option 2: You can create a new Conda environment.</p></li>
</ul>
<p>Installing libraries in an existing environment is simpler, but if you use the same environment for many projects, it will get big, complicated, and prone to package conflicts.</p>
<p><strong>Option 1:</strong> <em>Installing libraries in an existing Conda environment</em></p>
<p>Most of the libraries we need can be installed using Conda, by running the following commands in a Terminal.
If you are on a Mac or Linux machine, you should be able to use any Terminal.<br />
If you are on Windows, you might have to use the Anaconda Prompt, which you can find under the Start menu.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">jupyter</span> <span class="n">numpy</span> <span class="n">scipy</span> <span class="n">pandas</span> <span class="n">matplotlib</span> <span class="n">seaborn</span> <span class="n">libopenblas</span>
<span class="n">conda</span> <span class="n">install</span> <span class="o">-</span><span class="n">c</span> <span class="n">conda</span><span class="o">-</span><span class="n">forge</span> <span class="n">astropy</span> <span class="n">astroquery</span> <span class="n">astro</span><span class="o">-</span><span class="n">gala</span> <span class="n">python</span><span class="o">-</span><span class="n">wget</span>
</pre></div>
</div>
<p>In addition, theres one library we cant install with Conda, so we have to use <code class="docutils literal notranslate"><span class="pre">pip</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">pyia</span>
</pre></div>
</div>
<p><strong>Option 2:</strong> <em>Creating a new Conda environment</em></p>
<p>To create a new Conda environment, youll need to download an environment file from our repository.  On Mac or Linux, you can download it using <code class="docutils literal notranslate"><span class="pre">wget</span></code> on the command line:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">wget</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">raw</span><span class="o">.</span><span class="n">githubusercontent</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">AllenDowney</span><span class="o">/</span><span class="n">AstronomicalData</span><span class="o">/</span><span class="n">main</span><span class="o">/</span><span class="n">environment</span><span class="o">.</span><span class="n">yml</span>
</pre></div>
</div>
<p>Or you can <a class="reference external" href="https://raw.githubusercontent.com/AllenDowney/AstronomicalData/main/environment.yml">download it using this link</a>.</p>
<p>In a Terminal or Jupyter Prompt, make sure you are in folder where <code class="docutils literal notranslate"><span class="pre">environment.yml</span></code> is stored, and run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">env</span> <span class="n">create</span> <span class="o">-</span><span class="n">f</span> <span class="n">environment</span><span class="o">.</span><span class="n">yml</span>
</pre></div>
</div>
<p>Then, to activate the environment you just created, run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">activate</span> <span class="n">AstronomicalData</span>
</pre></div>
</div>
<p><strong>Run Jupyter</strong></p>
<p>If you are not familiar with Jupyter, you can <a class="reference external" href="https://jupyter.org/try">run a tutorial by clicking here</a>.
Then select “Try Classic Notebook”.  It will open a notebook with instructions for getting started.
Or you can run this <a class="reference external" href="https://colab.research.google.com/notebooks/intro.ipynb">introductory notebook on Colab</a>.</p>
<p>Before you launch Jupyter, <a class="reference external" href="https://raw.githubusercontent.com/AllenDowney/AstronomicalData/main/test_setup.ipynb">download this notebook</a>, which contains code to test your environment.</p>
<p>Or you can use <code class="docutils literal notranslate"><span class="pre">wget</span></code> to download it on the command line, like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">wget</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">raw</span><span class="o">.</span><span class="n">githubusercontent</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">AllenDowney</span><span class="o">/</span><span class="n">AstronomicalData</span><span class="o">/</span><span class="n">main</span><span class="o">/</span><span class="n">test_setup</span><span class="o">.</span><span class="n">ipynb</span>
</pre></div>
</div>
<p>To start Jupyter, run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">jupyter</span> <span class="n">notebook</span>
</pre></div>
</div>
<p>Jupyter should launch your default browser or open a tab in an existing browser window.
If not, the Jupyter server should print a URL you can use.  For example, when I launch Jupyter, I get</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ jupyter notebook
[I 10:03:20.115 NotebookApp] Serving notebooks from local directory: /home/username
[I 10:03:20.115 NotebookApp] 0 active kernels
[I 10:03:20.115 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 10:03:20.115 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
</pre></div>
</div>
<p>In this case, the URL is <a class="reference external" href="http://localhost:8888">http://localhost:8888</a>.<br />
When you start your server, you might get a different URL.
Whatever it is, if you paste it into a browser, you should should see a home page with a list of directories.</p>
<p>Now open the notebook you downloaded and run the cells that contain <code class="docutils literal notranslate"><span class="pre">import</span></code> statements.
If they work and you get no error messages, <strong>you are all set</strong>.</p>
<p>If you get error messages about missing packages, you can install the packages you need using Conda or <code class="docutils literal notranslate"><span class="pre">pip</span></code>.</p>
<p>If you run into problems with these instructions, let us know and we will make corrections.  Good luck!</p>
<div class="toctree-wrapper compound">
</div>
</div>

    <script type="text/x-thebe-config">
    {
        requestKernel: true,
        binderOptions: {
            repo: "binder-examples/jupyter-stacks-datascience",
            ref: "master",
        },
        codeMirrorConfig: {
            theme: "abcdef",
            mode: "python"
        },
        kernelOptions: {
            kernelName: "python3",
            path: "./."
        },
        predefinedOutput: true
    }
    </script>
    <script>kernelName = 'python3'</script>

              </div>
              
        </div>
    </div>
    
    
    <div class='prev-next-bottom'>
        
    <a class='right-next' id="next-link" href="01_query.html" title="next page">Chapter 1</a>

    </div>
    <footer class="footer mt-5 mt-md-0">
    <div class="container">
      <p>
        
          By Allen B. Downey<br/>
        
            &copy; Copyright 2020.<br/>
      </p>
    </div>
  </footer>
</main>


      </div>
    </div>

    
  <script src="_static/js/index.30270b6e4c972e43c488.js"></script>


    
  </body>
</html>
Description
An introduction to working with astronomical data in Python.
Readme MIT 60 MiB
Languages
Jupyter Notebook 68.8%
Batchfile 31.2%