[Python-modules-commits] [python-pysolar] 40/42: First cut at validation using Ipython Notebook

Wolfgang Borgert debacle at moszumanska.debian.org
Fri Oct 3 23:37:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag 0.6
in repository python-pysolar.

commit 4e6b78e5158d29f5cf394044bb4098a505bfe6ea
Author: Brandon Stafford <brandon at pingswept.org>
Date:   Sun Apr 20 15:05:37 2014 -0400

    First cut at validation using Ipython Notebook
---
 validation.ipynb | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 239 insertions(+)

diff --git a/validation.ipynb b/validation.ipynb
new file mode 100644
index 0000000..8d214c6
--- /dev/null
+++ b/validation.ipynb
@@ -0,0 +1,239 @@
+{
+ "metadata": {
+  "name": "",
+  "signature": "sha256:7426df37c5144b124ef60e6e751b5257e8a287164897b32c0fbf7e4d99b4f06e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+  {
+   "cells": [
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "%matplotlib inline"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [],
+     "prompt_number": 87
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "import pandas\n",
+      "pandas.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier\n",
+      "df = pandas.read_csv('pysolar_v_usno.csv', index_col='timestamp')"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [],
+     "prompt_number": 88
+    },
+    {
+     "cell_type": "heading",
+     "level": 3,
+     "metadata": {},
+     "source": [
+      "Azimuth error"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "print('Mean error: {0} degrees'.format(df.az_error.mean()))\n",
+      "print('Standard deviation: {0} degrees'.format(df.az_error.std()))\n",
+      "print('Minimum error: {0} degrees'.format(df.az_error.min()))\n",
+      "print('Maximum error: {0} degrees'.format(df.az_error.max()))"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "output_type": "stream",
+       "stream": "stdout",
+       "text": [
+        "Mean error: 0.00296459912856 degrees\n",
+        "Standard deviation: 0.00351558816448 degrees\n",
+        "Minimum error: 1.11582340878e-06 degrees\n",
+        "Maximum error: 0.123694436909 degrees\n"
+       ]
+      }
+     ],
+     "prompt_number": 90
+    },
+    {
+     "cell_type": "heading",
+     "level": 3,
+     "metadata": {},
+     "source": [
+      "Altitude error"
+     ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "print('Mean error: {0} degrees'.format(df.alt_error.mean()))\n",
+      "print('Standard deviation: {0} degrees'.format(df.alt_error.std()))\n",
+      "print('Minimum error: {0} degrees'.format(df.alt_error.min()))\n",
+      "print('Maximum error: {0} degrees'.format(df.alt_error.max()))"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "output_type": "stream",
+       "stream": "stdout",
+       "text": [
+        "Mean error: 0.0712700611102 degrees\n",
+        "Standard deviation: 0.121327977058 degrees\n",
+        "Minimum error: 7.88452119593e-06 degrees\n",
+        "Maximum error: 1.27552809011 degrees\n"
+       ]
+      }
+     ],
+     "prompt_number": 91
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "alt_error_plot = df.plot(x='alt1', y='alt_error', marker='.', linestyle='')\n",
+      "alt_error_plot.set_xlabel('Altitude [degrees]')\n",
+      "alt_error_plot.set_ylabel('Error [degrees]')\n",
+      "alt_error_plot.set_title('Error in altitude between USNO and Pysolar')"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "metadata": {},
+       "output_type": "pyout",
+       "prompt_number": 92,
+       "text": [
+        "<matplotlib.text.Text at 0xf8537ac>"
+       ]
+      },
+      {
+       "metadata": {},
+       "output_type": "display_data",
+       "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEdCAYAAAAW6PDWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVOX+B/DPHPYdBEFMURQFDUVDEQWNcUHM5IrZz9QQ\nNVvMzKzu1eoaaWWLJW2WZuaWmrleNTXMcMs9FUEUUVFERUSQdViGeX5/0JxmYIADM8w84Pf9evmS\nc86cM585c2a+c57nLDLGGAMhhBBSjWDqAIQQQvhEBYIQQohOVCAIIYToRAWCEEKITlQgCCGE6EQF\nghBCiE5UIP62YcMG9O/fH4IgQBAEyOVyhISEwNXVFYIgYNu2bSbNV1ZWhh49eiAgIAAVFRUGX/7o\n0aPF112XadOmwd3dHSkpKQZ77oiICEnPrUt8fDw8PDwgCAIOHjxosEw80bVtHj58GAAwYsQIuLu7\no2fPnvjii [...]
+       "text": [
+        "<matplotlib.figure.Figure at 0xf4d33ec>"
+       ]
+      }
+     ],
+     "prompt_number": 92
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "az_error_plot = df.plot(x='az1', y='az_error', marker='.', linestyle='')\n",
+      "az_error_plot.set_xlabel('Azimuth [degrees]')\n",
+      "az_error_plot.set_ylabel('Error [degrees]')\n",
+      "az_error_plot.set_title('Error in azimuth between USNO and Pysolar')\n",
+      "az_error_plot.set_xlim(0, 360)"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "metadata": {},
+       "output_type": "pyout",
+       "prompt_number": 93,
+       "text": [
+        "(0, 360)"
+       ]
+      },
+      {
+       "metadata": {},
+       "output_type": "display_data",
+       "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEdCAYAAAAIIcBlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXtcVNX6/z97z3Ab7qIopAiJouYdxRuYeNeSk1nHqCy1\n8py0y/F00U4ZXjp9O9oR63RTK1NKj9f6SWphhiXHa6koIoYGIiIichkYmIGZWb8/cHYzMMAMzAyz\n5Hm/Xr5k77Uvn7322utZ63nWWiMwxhgIgiAI4jZiWwsgCIIgnAsyDARBEIQJZBgIgiAIE8gwEARB\nECaQYSAIgiBMIMNAEARBmECGoRG2bt2KkSNHQhRFiKKI2NhYjB49GgEBARBFEV9//XWb6tNoNOjf\nvz8GDhyI2traO/q+N2/eRM+ePSGKIpYvX27ROSkpKejcuTNEUcRPP/1kZ4Vtg7kyevjwYQDA1KlT\nERgYiAEDB [...]
+       "text": [
+        "<matplotlib.figure.Figure at 0xfebf90c>"
+       ]
+      }
+     ],
+     "prompt_number": 93
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "longitude_error_plot = df.plot('longitude', 'alt_error', 'longitude', 'az_error', marker='.', linestyle='')\n",
+      "longitude_error_plot.set_xlabel('Longitude [degrees]')\n",
+      "longitude_error_plot.set_ylabel('Error [degrees]')\n",
+      "longitude_error_plot.set_title('Error between USNO and Pysolar as a function of longitude')\n",
+      "longitude_error_plot.set_xlim(0, 360)"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "metadata": {},
+       "output_type": "pyout",
+       "prompt_number": 94,
+       "text": [
+        "(0, 360)"
+       ]
+      },
+      {
+       "metadata": {},
+       "output_type": "display_data",
+       "png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAEdCAYAAADehBoAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl4E9X6x79J06QNoTtlLw0Uyg4Ksi8tSwVUFtGLgLKq\nuKIoXEDwAlevCKiAooJ6ryAXULHCDxS8IFagsiqb7FuhdKP73nQ9vz/qjJN0ZjKTZJJMPZ/n8ZFp\nZs75nv3M+55zRkMIIaBQKBQKRQG0nhZAoVAolPoLHWQoFAqFohh0kKFQKBSKYtBBhkKhUCiKQQcZ\nCoVCoSgGHWQoFAqFohguHWS2bduGvn37QqvVQqvVIjY2Fv3790doaCi0Wi127Njhyuhk89Zbb6FB\ngwbQauvv2Dp//nx06NABWq0WwcHBGDJkCAoLC3H16lXExsZCr9dj0KBBSEhIAAAcOnQI9957LwYM\nGIAHHngA7 [...]
+       "text": [
+        "<matplotlib.figure.Figure at 0xf67410c>"
+       ]
+      }
+     ],
+     "prompt_number": 94
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "latitude_error_plot = df.plot('latitude', 'alt_error', 'latitude', 'az_error', marker='.', linestyle='')\n",
+      "latitude_error_plot.set_xlabel('Latitude [degrees]')\n",
+      "latitude_error_plot.set_ylabel('Error [degrees]')\n",
+      "latitude_error_plot.set_title('Error between USNO and Pysolar as a function of latitude')\n",
+      "latitude_error_plot.set_xlim(-90, 90)"
+     ],
+     "language": "python",
+     "metadata": {},
+     "outputs": [
+      {
+       "metadata": {},
+       "output_type": "pyout",
+       "prompt_number": 95,
+       "text": [
+        "(-90, 90)"
+       ]
+      },
+      {
+       "metadata": {},
+       "output_type": "display_data",
+       "png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEdCAYAAAArepGwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl8E9X6/z+ZpEkbQnfKXhpa9n2nrC2FgigooheBq2x6\nve6gcBFBKfenIqCCol4RvIoIqFjgK4peECuCAgWhlH2ztHRv6ZamS5ae3x9hhsk0yyRNpqGc9+vF\ni852znOemZznnOc5i4wQQkChUCgUSgNhGlsACoVCoTQNqEGhUCgUikegBoVCoVAoHoEaFAqFQqF4\nBGpQKBQKheIRqEGhUCgUikfwqkHZvn07YmNjwTAMGIZBfHw8hg8fjrCwMDAMg127dnkze6e8+eab\naNasGRim6drVxYsXo1u3bmAYBiEhIRgzZgwqKipw+fJlxMfHQ6lUYtSoUUhJSQEA/Pbbb+jfvz9G\njBiBe++9F [...]
+       "text": [
+        "<matplotlib.figure.Figure at 0xf50418c>"
+       ]
+      }
+     ],
+     "prompt_number": 95
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "It may appear from the graph above that the latitude errors are worse in the northern hemisphere. I think that's not the case; we've just gathered around 10 times more data from the northern hemisphere because we didn't know how to retrieve data for the southern hemisphere from the USNO website until late 2013."
+     ]
+    }
+   ],
+   "metadata": {}
+  }
+ ]
+}
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pysolar.git



More information about the Python-modules-commits mailing list