{ "metadata": { "name": "", "signature": "sha256:691b7148afe233cab64e0412435d0a8f097f1a5051a07ac73216bcf91f1ab992" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "from IPython.core.display import HTML\n", "\n", "with open('creative_commons.txt', 'r') as f:\n", " html = f.read()\n", " \n", "name = '2013-10-28-ephem-ison'\n", "\n", "html = \"\"\"\n", "\n", "
This post was written as an IPython notebook. It is available for\n", "download or as a static\n", "html.
\n", "\n", "%s \"\"\" % (name, name, html)\n", "\n", "%matplotlib inline\n", "from matplotlib import style\n", "style.use('ggplot')" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since the last post I've been playing more with\n", "[PyEphem](http://rhodesmill.org/pyephem/). One of the many interesting features of this\n", "astronomical computations module is the ability to read external orbital elements.\n", "\n", "Here is an example on how to create an [ISON comet](http://www.nasa.gov/content/goddard/timeline-of-comet-ison-s-dangerous-journey/)\n", "object.\n", "\n", "We can get the ISON comet orbital data from\n", "[this](http://www.minorplanetcenter.net/iau/Ephemerides/Comets/Soft03Cmt.txt)\n", "link." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import ephem\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "ISON = \"C/2012 S1 (ISON),h,11/28.7744/2013,62.3994,295.6528,345.5644,1.000002,0.012444,2000,7.5,3.2\"\n", "comet = ephem.readdb(ISON)\n", "print(comet)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "| \n", " | Earth | \n", "Sun | \n", "Sun km | \n", "Earth km | \n", "
|---|---|---|---|---|
| 2013-10-28 | \n", "1.343978 | \n", "1.091559 | \n", "1.632950e+08 | \n", "2.010563e+08 | \n", "
| 2013-10-29 | \n", "1.315059 | \n", "1.068280 | \n", "1.598124e+08 | \n", "1.967301e+08 | \n", "
| 2013-10-30 | \n", "1.286399 | \n", "1.044747 | \n", "1.562919e+08 | \n", "1.924426e+08 | \n", "
| 2013-10-31 | \n", "1.258032 | \n", "1.020949 | \n", "1.527318e+08 | \n", "1.881990e+08 | \n", "
| 2013-11-01 | \n", "1.229998 | \n", "0.996874 | \n", "1.491302e+08 | \n", "1.840051e+08 | \n", "
This post was written as an IPython notebook. It is available for\n", "download or as a static\n", "html.
\n", "\n", "