Last active
June 11, 2017 22:51
-
-
Save bjlittle/d0046bcf4b3e57dde635411e3ff56b95 to your computer and use it in GitHub Desktop.
Raster regrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# %matplotlib nbagg" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"import numpy as np\n", | |
"\n", | |
"from agg_regrid._agg import raster" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This is the simple toy example to explore the behaviour of a raster regrid of a single source cell to a single target cell. The target cell has been back projected into the same co-ordinate system as the source cell, and for the purpose of this example, the source cell is regular and larger than the target cell. The target cell covers 1/8th of the source cell, as a diamond in the centre of the source cell ..." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": true, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# The source cell point value.\n", | |
"src_value = 80" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def grid(n, value, plot=True, quiet=False):\n", | |
" \"\"\"\n", | |
" Basic raster regrid of a single target cell within a single source cell.\n", | |
" \n", | |
" Args:\n", | |
" n : int\n", | |
" Number of (n x n) raster cells.\n", | |
" value : float\n", | |
" The point value of the source cell.\n", | |
" plot : boolean\n", | |
" Plot the raster target cell within the source cell.\n", | |
" quiet : boolean\n", | |
" Control verbosity of diagnostics.\n", | |
" \n", | |
" \"\"\"\n", | |
" # Create the raster cell space that covers the source cell.\n", | |
" shape = (n, n)\n", | |
" cells = np.ones(shape, dtype=np.float16) * value / np.prod(shape)\n", | |
" # Raster the target cell within the source cell.\n", | |
" weights = np.zeros(shape, dtype=np.uint8)\n", | |
" xi = np.array([[0.5, 0.75], [0.25, 0.5]], dtype=np.float64) * n\n", | |
" yi = np.array([[0.25, 0.5], [0.5, 0.75]], dtype=np.float64) * n\n", | |
" raster(weights, xi, yi)\n", | |
" # Calculate the contribution of the source cell to the target cell.\n", | |
" result = np.sum((weights / 255.) * cells)\n", | |
" if not quiet:\n", | |
" print weights\n", | |
" print 'weights sum = {}'.format(weights.sum())\n", | |
" print '{} of {} elements populated'.format(len(np.where(weights > 0)[0]), weights.size)\n", | |
" fraction = np.sum((weights / 255.) * cells) / value\n", | |
" print 'result = {}'.format(result)\n", | |
" print 'fraction = {} -> {}'.format(fraction, 1. / 8)\n", | |
" print 'error = {} %'.format(((value / 8.) - result) / (value / 8.) * 100)\n", | |
" if plot:\n", | |
" plt.pcolormesh(weights, vmin=0, vmax=255, cmap='gray_r')\n", | |
" plt.colorbar()\n", | |
" plt.xlim(0, n)\n", | |
" plt.ylim(0, n)\n", | |
" plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"Let's now crank up the raster cell space (represented by a pixel buffer) that covers the source cell, to determine the speed and accuracy of this particular example scenario raster regrid. AGG will render the target cell in the pixel buffer using a filled grey-scale image, where each pixel is represented by a uint8, thus giving rather crude quantized valued in the range 0...255. But it's rather surprising the accuracy that can be achieved ...\n", | |
"\n", | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[31]]\n", | |
"weights sum = 31\n", | |
"1 of 1 elements populated\n", | |
"result = 9.72549019608\n", | |
"fraction = 0.121568627451 -> 0.125\n", | |
"error = 2.74509803922 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWEAAAEACAYAAABiV8coAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF8FJREFUeJzt3X+QXWV9x/H3Z4HYqpASUkMNgdWEHzEtxqhxt/4CREiY\njkHGQcCxApUyIspERyF2HPqHnahVV5SihMaIjjRSsCZahPDDjkNnFwImENhEFmJCsphYAmKhAybh\n2z/uIV5v9u49e8/ZPHePn9fMGe4597nnfM8kfHh4znPOUURgZmZpdKUuwMzsj5lD2MwsIYewmVlC\nDmEzs4QcwmZmCTmEzcwSahnCkpZL2inpwVHafE3SkKT1kuaWW6KZWXXl6QmvAE5v9qWkhcDMiDgW\nuBj4Zkm1mZlVXssQjoi7gadHabII+E7W9h5gsqRp5ZRnZlZtZYwJTwe21a0PZ9vMzKwFX5gzM0vo\n4BL2MQzMqFs/Ktu2H0l+UIWZ5RYRKvL7MWbO1ojoLnK8duQNYWXLSFYDHwW+L6kH+E1E7Gy2oy1b\ntoypwImgr6+PxYsXpy6jVFU8J6jmeVXxnAC6u7tL2Y+UL8cj4phSDjhGLUNY0g3AScARkh4HrgQm\nARERyyLiFklnSHoUeA64YDwLNjMbizGE8DhXMrKWIRwR5+Voc2k55ZiZlStvCKdSxpjwH72enp7U\nJZSuiucE1TyvKp5Tmbq68s0/2Lt37zhXMjIdyC64pKjimLCZla+7u7uUC3OTJk3K1fZ3v/td4eO1\nwz1hM6s0D0eYmSXU6SHsmzXMrNIk5Vqa/PYoSXdJeljSBkkfb/j+k5JelDSlbtuS7IF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\nYoJmRTt8s4aZWUId/nghM7NqcwibmSXkEDYzS8ghbGaWkEPYzCwhh7CZWUIOYTOzhBzCZmYJ/T8b\nJWAsJamvqgAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb7c56d50>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Use a single pixel to represent the source cell, and exercise the sub-pixel accuracy of AGG ...\n", | |
"grid(1, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The slowest run took 21.89 times longer than the fastest. This could mean that an intermediate result is being cached.\n", | |
"10000 loops, best of 3: 108 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(1, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[31 31]\n", | |
" [31 31]]\n", | |
"weights sum = 124\n", | |
"4 of 4 elements populated\n", | |
"result = 9.72549019608\n", | |
"fraction = 0.121568627451 -> 0.125\n", | |
"error = 2.74509803922 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWEAAAEACAYAAABiV8coAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFQJJREFUeJzt3X/wXXWd3/HnK0K23YJUpIZOEvi6AdeQThtdG5NKN2xV\nJE4HdrcU3XVm/dHpMiIDw3Z2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UktUpVTY24iUHybyR9Q7iqXkxyOXAXnTHkm6pq\nT5JLOx/XjVV1R5J3J/kB8BzwwXEWKUlN6JV/49xHul1sSVIDFmXE2os7juh3LJJsTvJMkoe6y8ea\nqHOxJbkpyYEk312gzVI5JxY8FkvlnABIsirJPUkeTrIryRU92rX33BjnAHO3V70M+AFwJnAisBN4\n45w2W4CvdV+/Fdg+7jomYRnwWGwGtjVd6zE4FucC64Hv9vh8SZwTAx6LJXFOdP9fTwfWd1+fBHx/\nqeXFYvSEvbjjiEEnerf+B8uqug/4yQJNlso5McixgCVwTgBU1f6q2tl9/Sywh1fOw231ubEYIezF\nHUcMOtF7U/efWV9Lcs6xKW3iLJVzYlBL7pxIMkXnXwj3z/mo1eeGF2s070HgjKp6vnsPjq8Cb2i4\nJjVryZ0TSU4Cvgxc2e0RLxmL0RPeB5wx6/2q7rq5bVb3adMGfY9FVT1bVc93X/934MQkpx67EifG\nUjkn+lpq50SSE+gE8Oer6vZ5mrT63FiMED48uTnJcjqTm7fNabMN+B2AhS7uaIG+x2L22FaSDXSm\nDT59bMs8ZkLvsc6lck68pOexWGLnBMBngd1VdUOPz1t9box9OKK8uOOwQY4FcHGSDwMHgZ8C72mu\n4sWT5IvAecBrkzwOXAcsZ4mdE9D/WLBEzgmAJG8D3gfsSrKDzuXD19KZUbQkzg0v1pCkBk347YUk\nqd0MYUlqkCEsSQ0yhCWpQYawJDXIEJakBhnCktQgQ1iSGvT/AdzLpWZGVRGUAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb78a42d0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 2x2 pixel buffer for the raster cells ...\n", | |
"grid(2, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"10000 loops, best of 3: 112 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(2, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[ 0 0 0 0]\n", | |
" [ 0 127 127 0]\n", | |
" [ 0 127 127 0]\n", | |
" [ 0 0 0 0]]\n", | |
"weights sum = 508\n", | |
"4 of 16 elements populated\n", | |
"result = 9.96078431373\n", | |
"fraction = 0.124509803922 -> 0.125\n", | |
"error = 0.392156862745 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWEAAAEACAYAAABiV8coAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGpNJREFUeJzt3X+sXOV95/H350LM0gWcGG+cyD+JIY1h1TVR1sCC6qFt\nEkwre9tlTRIkkrC7taAIVFZRg5fVvZZ2RZtVgyAFETfEAhoKXpoFdzHBEDOwRMaAfV0cbKe2AOM6\n9WWLcSIDS2z47h9z7EyGmTvnzjkz5/j485JGPnPOc5/zvUfX3/vcZ54figjMzKwYQ0UHYGZ2PHMS\nNjMrkJOwmVmBnITNzArkJGxmViAnYTOzAqVOwpKGJG2WtKbD9dsk7ZS0RdL8/EI0M6uuibSErwe2\ntbsgaREwNyLOApYBd+YQm5lZ5aVKwpJmAJcC3+lQZAlwD0BEbAQmS5qWS4RmZhWWtiV8C/A1oNP0\nuunAnqb3e5NzZmY2jq5JWNLvAmMRsQVQ8jIzsxycmKLMhcBiSZcCJwOnSronIq5sKrMXmNn0fkZy\n7ldI8kIVZpZaR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4FpKmSpqcHJ8MfJbGLNNmfX0WaWLo97OIiOURMSsiPkHj/+j6iLiypdgg\n/48UIve1I6IEkzvSxABcJulq4BDwDnB5njEASLoPqAGnS3oNGAYmMaDnkDYOBvMsLgSuALYm/ZAB\nLKcxgmUgzyNNDAzgWQAfB+5WY5nEIeCB5Hsf5ASorjEwmGfxAQN+DoXzZA0zswIdzx/MmZkVzknY\nzKxATsJmZgVyEjYzK5CTsJlZgZyEzcwK5CRsZlYgJ2EzswL9f/URfVgtYP4xAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb56c7410>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 4x4 pixel buffer for the raster cells ...\n", | |
"grid(4, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"10000 loops, best of 3: 113 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(4, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[ 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 127 127 0 0 0]\n", | |
" [ 0 0 127 255 255 127 0 0]\n", | |
" [ 0 0 127 255 255 127 0 0]\n", | |
" [ 0 0 0 127 127 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0]]\n", | |
"weights sum = 2036\n", | |
"12 of 64 elements populated\n", | |
"result = 9.98039215686\n", | |
"fraction = 0.124754901961 -> 0.125\n", | |
"error = 0.196078431373 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAVcAAAEACAYAAAAHujVXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGANJREFUeJzt3X+sXOV95/H3xzgQfpqAE0hs88uUxrDtAk0hCrRMFkIg\n3Zq2aikhUiHZTVZLuqBkFQVYre61tCuarBJKu420NMQxkfnpQqFdmgChQ5fK4ed1MNgkVo3BMbFJ\n+JV10CY2fPaPOZibm3vvHM/MmTnHfF7S1T1z5sw5Xyzz8TPPec7zyDYRETFYc0ZdQETEnijhGhFR\ngYRrREQFEq4RERVIuEZEVCDhGhFRgVLhKukzkp6Q9LiklZL2rrqwiIgm6xqukt4D/CfgZNu/DswF\nLqi6sIiIJptb8ri9gP0lvQ7sBzxXXUkREc3XteVq+zngS8CzwBbgZdv3Vl1YRESTlekWOBg4DzgS\neA9wgKQLqy4sIqLJynQLnAVstP0igKTbgA8AN0w+SFImKYiIUmyrn8/vZt48Y/uofq7XizKjBZ4F\n3i/p7ZIEnAmsn+5A2yP9GRsbG3kNdakjNdSrjjrUUJc6BkVSqR8637qHrmvL1fZDklYBE8CO4ve1\nVRcWETGbIji7GmSg745SowVsLwOWVVxLRERpZcN1VMoOxWqEVqs16hKAetSRGt5UhzrqUAPUp45B\nmDOn3AOmr732WsWVTE+DajJL8qia3xHRHJLwAG5o7b13uQdFf/7zn/d9vV7sUS3XiHjrSLdAREQF\n6h6umRUrIhppN4ZiTffZhZLuk/SkpLWSLp3y/n+W9LqkQybtu0LSBknrJZ3drb60XCOikfpsue4E\nPmt7jaQDgEcl3W37KUkLgQ8Bz0y61hLgfGAJsBC4V9KvzHajKS3XiGikflqutrfaXlNsb6fzYNSC\n4u2rgc9N+ch5wE22d9re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ata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 8x8 pixel buffer for the raster cells ...\n", | |
"grid(8, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"10000 loops, best of 3: 121 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(8, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 127 127 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 127 255 255 127 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 127 255 255 255 255 127 0 0 0 0 0]\n", | |
" [ 0 0 0 0 127 255 255 255 255 255 255 127 0 0 0 0]\n", | |
" [ 0 0 0 0 127 255 255 255 255 255 255 127 0 0 0 0]\n", | |
" [ 0 0 0 0 0 127 255 255 255 255 127 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 127 255 255 127 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 127 127 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", | |
" [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]\n", | |
"weights sum = 8152\n", | |
"40 of 256 elements populated\n", | |
"result = 9.99019607843\n", | |
"fraction = 0.12487745098 -> 0.125\n", | |
"error = 0.0980392156863 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV4AAAEACAYAAAD7rx6dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGSdJREFUeJzt3X+wXGWd5/H35xIYUX7DAmsSAoTBiVkVKERWGGgFFZ0R\nnKkZisFdCezObokjlEyxkvhHQtXugsw6LOMOVeuIMVAwTERW4hYrMcZ2l5oAAgkEEthUBUImbMLy\nSwunFnPhs3/0SWwu90enz7mnT5rPq6rL7tOnz/PN5frp5z7nnOeRbSIioj4jgy4gIuKdJsEbEVGz\nBG9ERM0SvBERNUvwRkTULMEbEVGzKYNX0i2Sdkh6fMz2L0vaKGm9pOunr8SIiOEyo4d9lgLfBG7d\ntUFSC/gs8AHbo5KOmJ7yIiKGz5Q9Xtv3A6+M2fxF4Hrbo8U+L05DbRERQ6nfMd4TgbMkPSDpp5JO\nrbKoiIhh1stQw0SfO9T26ZI+DCwHjq+urIiI4dVv8G4F7gaw/XNJb0o63PZLY3eUlMkgIqJntlXm\n83uYOVtsH1umvX70OtSg4rHLD4CPA0g6Edh3vNDdxfZAH4sXLx54DU2powk1NKWOJtTQlDqaUINd\nXR9NUk8PYE5lje6BKXu8ku4AWsDhkp4DFgPfAZZKWg+8DnxhOouMiNgTRahOqcqw3xNTBq/tiyd4\n619WXEtERCV6Dd5B6XeMd6/SarUGXQLQjDqaUAM0o44m1ADNqKMJNVRpZKS3UdQ33nhjmisZn6a7\nqy3Jg+rOR8TeRRKu4OTafv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s+w3gbuCjNdfQ\nbYekowAkHQ28MKhCJC2gMxw1iC+iucCxwGOSnqHz/9dHJA3iL4CtdH4vsP1z4E1Jhw+gjmk1XcH7\nc+AESXOKs9YXAYM6m/8dYIPtmwbRuO1Fto+xfTydn8Nq218YQB07gK2STiw2nUP9J/ueA06X9C51\nbpQ/h3pP8I39i2MFsKB4fglQ1xfzW+qQdB6doajzbb9edw22n7B9tO3jbR9H50v6ZNt1fBGN/W/y\nA+DjAMXv6r62X6qhjnrZnpYHcB6dO0A2AddMVztT1HAG8AawDlgLPAqcN4hainrOBlYMsP0P0flS\nXEenV3HwAGpYTCdsH6dzQmvfmtq9g86JvNfpfAFcChwKrCp+T1cChwyojk10riR4tHjcXHcNY97f\nDBw2oJ/FDOA2YD3wMHB23b+jdTxyA0VERM3eESfXIiKaJMEbEVGzBG9ERM0SvBERNUvwRkTULMEb\nEVGzBG9ERM0SvBERNfv/EnQgyXt8FrQAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb78a4290>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 16x16 pixel buffer for the raster cells ...\n", | |
"grid(16, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1000 loops, best of 3: 131 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(16, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 32624\n", | |
"144 of 1024 elements populated\n", | |
"result = 9.99509803922\n", | |
"fraction = 0.12493872549 -> 0.125\n", | |
"error = 0.0490196078431 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV4AAAD7CAYAAAAijfzzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF6tJREFUeJzt3X+wXGV9x/H35wKhIkgDkaSTREChGFNpQjHSgnWpCsFx\nCFInRfwDBC1TRJja6ZjQP25wdPjRMQ7aMtMKhOhAIeIPwFEIFLcMTvidSCABMxMD4WJubIhgZIoJ\n+faPcwKby+7dc/ecPffck89rZofds2fP+eaEfO5zn33O8ygiMDOz8gyMdwFmZvsaB6+ZWckcvGZm\nJXPwmpmVzMFrZlYyB6+ZWcn27/cJJHm8mpllFhHK8/kxZs5zEXFUnvP1opQWb0RU/jE4ODjuNbhO\n17iv11kUSZkewJGFnXQM+t7iNTMrWxqqXRUZ9mPh4DWz2skavOPFwZtqNBrjXUImrrM4E6FGcJ29\nGBjI1ov6+uuv97mS9tTvprakGK/mvJlNLJKIAr5cmzRpUqZ9//CHP+Q+Xy/c4jWz2nFXg5lZyaoe\nvL6BwsxqZwzDyUZ+boak+yU9LWmtpEtHvP9PknZLOqxl22JJGyStl3Ralvq6tnglHQg8AExK9789\nIq6QNBm4jWQc3CZgYUS8nOWkZmb9lKPFuwv4UkSskXQw8LiklRHxjKQZwMeA51rOMwtYCMwCZgD3\nSTq22xdbXVu8EfEacGpEzAXmAGdImgcsAu6LiOOA+4HFPf0xzcwK1muLNyK2RMSa9Pk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9H6SL88G0sdtEfE1SYdRoWtZZb6BwsysZP5yzcysZA5eM7OS\nOXjNzErm4DUzK5mD18ysZA5eM7OSOXjNzErm4DUzK9n/A0YqFYszeBvIAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb5580d10>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 32x32 pixel buffer for the raster cells ...\n", | |
"grid(32, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 17, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The slowest run took 21.54 times longer than the fastest. This could mean that an intermediate result is being cached.\n", | |
"1000 loops, best of 3: 172 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(32, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 130528\n", | |
"544 of 4096 elements populated\n", | |
"result = 9.99754901961\n", | |
"fraction = 0.124969362745 -> 0.125\n", | |
"error = 0.0245098039215 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV4AAAD7CAYAAAAijf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WElGMjyZxvoV4NSqxVjllydQmJmVzF+umZmVzInXzKxkTrxmZiVz4jUz\nK5kTr5lZyZx4zcxK5sRrZlYyJ14zs5L9PwKEetkPSxOXAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb5587a50>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 64x64 pixel buffer for the raster cells ...\n", | |
"grid(64, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 19, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1000 loops, best of 3: 311 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(64, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 522176\n", | |
"2112 of 16384 elements populated\n", | |
"result = 9.9987745098\n", | |
"fraction = 0.124984681373 -> 0.125\n", | |
"error = 0.0122549019608 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWQAAAD7CAYAAABdXO4CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0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3At8QNKXgX0J1QjZXz57I2Jzvv1VsoBO6WcJ8EFgd0S8GBFHgK8Dv0B6dR7V\nrK5hYHbNcV3/vZK0kGxo7eM1u5OrMyXdCOTvAGdLmiNpOvBRYG0X6mjmLmB7RNxWs28tsDB/fTWw\npv5NkyUilkXEGyPiTWQ/u8ci4pPAQyRSI0D+Z/VeSW/Nd10KPENCP8vcc8BFkl6bf7h0KdmHpanU\nKX7yL6Fmda0FPprPEDkLOJvsxoXJ8hN1SrqcbFjtyog4VHNct+tMW0RM+hdwOdkdL7uAJd2ooUld\nFwNHgK3AFuDJvNZTgPV5zeuA13e71rze9wFr89fJ1Ug2s+I7+c/za8DJida5nOwD3KfIPiiblkKd\nwD3A88Ahsn84rgFmNKuLbCbDv+f/XT7U5Tp3Ac/mv0NPArd3u85e+PKNIWZmifCHemZmiXAgm5kl\nwoFsZpYIB7KZWSIcyGZmiXAgm5klwoFsZpYIB7KZWSL+H+2tERb31y8EAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb54a3110>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 128x128 pixel buffer for the raster cells ...\n", | |
"grid(128, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1000 loops, best of 3: 865 µs per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(128, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 2088832\n", | |
"8320 of 65536 elements populated\n", | |
"result = 9.9993872549\n", | |
"fraction = 0.124992340686 -> 0.125\n", | |
"error = 0.00612745098039 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWQAAAD7CAYAAABdXO4CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGW9JREFUeJzt3XHQXFV9xvHvEylUBSEaSToJgoKVkNYGpkZbsN1WRXQc\nY22HsfgHiLadgpXRTmtC/3iTTjsYO9axVqatxjQ6UEqtLegoBKTbTtoQtHkjwcQ0DA3EVxNsQTux\nFgn8+se9G5Y3u+/e3Xt399zd5zOzw+7Zu/eeO5s8nJz93XMVEZiZ2fgtGncHzMws40A2M0uEA9nM\nLBEOZDOzRDiQzcwS4UA2M0vESb02kLQC+AywFHga+KuI+LikGeA3gEfzTa+PiDvyz6wHrgaOAddF\nxLYO+3W9nZkVFhEq8/k+M+fhiDinzPEGEhELPoBlwOr8+anAfuB8YAb4QIftVwKzZGF/DvAgoA7b\nxaSZmZkZdxcq5fNJ36SdU7fzyfOiZ14t9ABCUqFHFccb5NFzyiIiDkfE7vz5UWAfsDx/u9P/sdYC\nt0TEsYg4CBwA1vT5/wkzs8pJKvQYl77mkCWdA6wGduZN75W0W9KnJJ2ety0HDrV9bI5nAtzMbGwm\nJpAlnQp8jmxO+ChwI/CyiFgNHAY+Mpwu1kej0Rh3Fyrl80nfpJ3TsM9n0aJFhR7joiiwloWkk4Av\nAl+OiI91eP9s4AsR8UpJ68jmXzbl790BzETEznmfiZmZme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bloRJz4L4y1wNb8\n+VbgbSPtUZ8iYjvw+LzmbufwVuCWiDgWEQeBA2TfZTK6nA9k39V8a0n/fA5HxO78+VFgH7CCmn5H\nXc6nVcdby++oauMI5Em5aCSAuyR9VdJ78ralEXEEsj98wJlj693gzuxyDvO/tznq8729V9JuSZ9q\n++d9rc5H0jlko/976f7nrDbn1HY+O/Om2n9HVUi7SjptF0fERcCbgWslvZYspNtNwi+mdT+HG4GX\nRcRq4DDwkTH3p2+STgU+B1yXjyxr/eesw/nU/juqyjgCeQ54SdvrFXlbrUTEd/L/fhf4R7J/Sh2R\ntBRA0jLg0fH1cGDdzmEOOKttu1p8bxHx3cgnJIFP8sw/eWtxPpJOIguvz0bEbXlzbb+jTudT9++o\nSuMI5K8C50k6W9LJwDuA28fQj4FJel7+f3kkPR+4FNhDdh5X5ZtdCdzWcQdpEc+ev+t2DrcD75B0\nsqSXAueRFcan5lnnkwdWy9uBB/LndTmfTwN7I+JjbW11/o5OOJ8J+I6qM45fEoHLyH5hPQCsG/cv\nmwP0/6Vk1SGzZEG8Lm9/IXB3fm7bgDPG3dce53Ez8G3gCeAR4F3A4m7nAKwn+6V7H3DpuPtf8Hw+\nA9yff1//SDb/WpfzuRh4qu3P2q78707XP2cpn9MC51Pb76jqhy8MMTNLhH/UMzNLhAPZzCwRDmQz\ns0Q4kM3MEuFANjNLhAPZzCwRDmQzs0Q4kM3MEvH/PcteOz6auyMAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb7954fd0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 256x256 pixel buffer for the raster cells ...\n", | |
"grid(256, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"100 loops, best of 3: 3.03 ms per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(256, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 8355584\n", | |
"33024 of 262144 elements populated\n", | |
"result = 9.99969362745\n", | |
"fraction = 0.124996170343 -> 0.125\n", | |
"error = 0.00306372549016 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWQAAAD7CAYAAABdXO4CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGyBJREFUeJzt3X+wXOV93/H3RxAUCBiEZURGAoPBwUINkZhEdguJN8H8\ncjKIdDIMsZsBY7czhYwZ03Etkelc6Y/WljMp46Rm2sayRiYiWCFgiY4HJCzf6aiVBI6uLBnJqjqq\nQLlGFxuwPbJdKsG3f5xzxXJ1V3t2z9m7z9n9vGbusPvcs+cHOvvRo+95nnMUEZiZWf/N6vcOmJlZ\nxoFsZpYIB7KZWSIcyGZmiXAgm5klwoFsZpaIM4ssJOkw8BPgLeB4RCyVNAf4OvBe4DBwR0T8JF9+\nBXAPcAK4PyI2T7NOj7czs8IiQmU+32HmvBgRl5XZXjeK9pDfAhoRsSQiluZty4FnI+IqYCuwAkDS\n1cAdwELgVuBhSdP+j4yIgfo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rcXxNLkuIl6W9B5gs6QD1PTPqBf60UMeBy5ter8g\nb6ujCUnzACRdDLySt48DlzQtl+QxSjqTLIwfiYiNeXOtjwkgIn4KjAK3UN/juQ64TdIh4G+B35P0\nCHC0pscDQES8nP/3h8A3yEoQdf0zqlw/Avl54EpJ75V0FnAnsKkP+9EN5T+TNgF356/vAjY2td8p\n6SxJlwNXkg0iT81XgX0R8aWmtloek6S5k1fnJZ0N3EhWF6/l8UTEgxFxaUS8j+w7sjUi/gR4ihoe\nD4Ckc/J/kSHpV4CbgL3U9M+oJ/pxJZGs53KArEi/vN9XNgvu86PAD4A3gJeATwBzgGfzY9kMXNC0\n/Aqyq8L7gZv6vf/THM91wJtko1zGgF35n8uFdTwm4NfzY9gN7AH+LG+v5fFMObYP8/Yoi9oeD3B5\n0/m2d/K7X+djqvrHE0PMzBKR9q2PzMyGiAPZzCwRDmQzs0Q4kM3MEuFANjNLhAPZzCwRDmQzs0Q4\nkM3MEvH/AfiXeac/QkokAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb55ae150>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 512x512 pixel buffer for the raster cells ...\n", | |
"grid(512, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 25, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"100 loops, best of 3: 11.8 ms per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(512, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 33422848\n", | |
"131584 of 1048576 elements populated\n", | |
"result = 9.99984681373\n", | |
"fraction = 0.124998085172 -> 0.125\n", | |
"error = 0.00153186274503 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD7CAYAAABDld6xAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHCtJREFUeJzt3X+QXeV93/H3R2AwNgJEKFKjFT/MLwsSDKoNtOCwMS4/\nHI8gnQyDYVJ+TTpTSKXijGuJ/rGrP2osUpdCajp1wIpMwBjjZJBTCkLGm44m4oeDFMlIYHlUgbxU\nS1wwGbkuw8K3f5xn4bLs3b33nvvjOfd+XjM7c+/Zc899Djrnsw/f5znnKCIwM7N8zet1A8zMbHYO\najOzzDmozcwy56A2M8ucg9rMLHMOajOzzB081wqS7gU+D0xExJlp2QLgO8DxwF7gyoh4I/1uNXAD\nMAmsjIiNafky4M+ADwOPRsS/neU7PWfQzBoWEWr1s03mzUsRcUKr39WqRnrU64BLpi1bBWyKiNOA\nJ4HVAJJOB64ElgKXAXdLmvoP+F+BGyPiVOBUSdO3+T4R0Tc/IyMjPW+D92ew9mmQ9qcdJDX0Q9E5\n7bo5gzoiNgOvT1t8ObA+vV4PXJFeLwcejIjJiNgL7AbOkbQImB8Rz6b1vlXzGTOznmoiqHtiztJH\nHcdGxARAROyXdGxavhjYUrPeeFo2CfysZvnP0nIzs57rZQg3otWgns415VkMDw/3uglt1W/7A/23\nT96f5syb19i8irfffruj7ain1aCekLQwIiZSWePVtH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KOaKbgNmm5taif1JDgaWAV+PiGXAL4FVVPff6CiKnufxFGWQj0q6horuzxz6YR9Kyymo\nx4Hjat4PpWXZS//7+TBwX0Q8khZPSFqYfr8IeDUtHweW1Hw8t/08H1guaQ/wbeAzku4D9ld0f6Do\nZe2LiB+l99+jCO6q/ht9FtgTEa9FxNvAXwL/jOruT61m96FK+9aynIL6WeBkScdLOgS4CtjQ4zY1\n6pvAzoi4s2bZBuC69Ppa4JGa5VelUfoTgZMpJshnISJujYjjIuJjFP8GT0bE7wPfp4L7A5D+V3qf\npFPToouA56novxFFyeM8SR9WcQOKi4CdVHN/xPv/z62pfUjlkTcknZP+W/zLms/0j16PZtb+AJdS\nzJrYDazqdXsabPP5wNsUs1S2As+l/Tga2JT2ZyNwVM1nVlOMWu8CLu71Psyybxfy3qyPSu8P8AmK\nzsA24C8oZn1Udp+AkdS27RSDbh+q2v4ADwCvAG9S/PG5HljQ7D4A/wTYkXLjzl7vVyd+fMGLmVnm\ncip9mJnZDBzUZmaZc1CbmWXOQW1mljkHtZlZ5hzUZmaZc1CbmWXOQW1mlrn/D3D0svk7zk0YAAAA\nAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb53a18d0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 1024x1024 pixel buffer for the raster cells ...\n", | |
"grid(1024, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"10 loops, best of 3: 48.6 ms per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(1024, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 28, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 133692416\n", | |
"525312 of 4194304 elements populated\n", | |
"result = 9.99992340686\n", | |
"fraction = 0.124999042586 -> 0.125\n", | |
"error = 0.000765931372424 %\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD7CAYAAABDld6xAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGt9JREFUeJzt3X+wXGV9x/H3J1JBS4TQSNJJIlABDVYNqaadUuW2yi+n\nQ6jtMBSnimjtFBXUjiWxztybjh2IHX/SodMKYnCgSHVasKaQpHiHYRqSIDcSTITL0ITkam7sBHFi\nleGGb/8454bNzZ7dvfvz2T2f18wOe589e87Zw3M+++R5nrNHEYGZmaVrTq93wMzManNQm5klzkFt\nZpY4B7WZWeIc1GZmiXNQm5kl7rh6C0haDNwOLABeBL4SEV+WNA/4BnAasBu4PCKey9+zGrgamAKu\ni4gNefly4GvACcD6iPhYwTY9Z9DMGhYRava9s8ybPRFxerPbalpE1HwAC4Fl+fMTgSeA1wNrgb/O\ny68HbsyfnwOMkX0JnA48BSh/bQvw1vz5euCigm1G2Q0PD/d6F3rOxyDj41D7GOR5UTfLih5ASGro\n0eq2mn3U7fqIiP0RsT1/fgjYBSwGVgLr8sXWAZflzy8F7oqIqYjYDYwDKyQtBOZGxLZ8udsr3mNm\n1jOSGnr0St2uj0qSTgeWAQ8DCyJiErIwl3RqvtgiY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Xo5mVD+BistHfcWBVr/eng5/zDLJZLWNkAb0qLz8F2JQfgw3AyRXvWU020r0LuLDXn6GF\nz34n8CPgeeAZ4P3AvNl+buC38mM3Dnyp15+rDcfgduCxvF78O1lf7SAfg/OAwxXnwaP5+T/rc6Cf\nj0OjD1/wYmaWuJS6PszMrAoHtZlZ4hzUZmaJc1CbmSXOQW1mljgHtZlZ4hzUZmaJc1CbmSXu/wGb\n+ZY/7G0CoQAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7efdb5396290>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 2048x2048 pixel buffer for the raster cells ...\n", | |
"grid(2048, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 29, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1 loop, best of 3: 208 ms per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(2048, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"deletable": true, | |
"editable": true | |
}, | |
"source": [ | |
"----" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 30, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[[0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" ..., \n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]\n", | |
" [0 0 0 ..., 0 0 0]]\n", | |
"weights sum = 534771712\n", | |
"2099200 of 16777216 elements populated\n", | |
"result = 9.99996170343\n", | |
"fraction = 0.124999521293 ->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figure.Figure at 0x7efdb54b0ed0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Try a 4096x4096 pixel buffer for the raster cells ...\n", | |
"grid(4096, src_value)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 31, | |
"metadata": { | |
"collapsed": false, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1 loop, best of 3: 778 ms per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%%timeit\n", | |
"grid(4096, src_value, plot=False, quiet=True)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true, | |
"deletable": true, | |
"editable": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.12" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment