Skip to content

Instantly share code, notes, and snippets.

@dawehner
Created March 24, 2016 06:35
Show Gist options
  • Save dawehner/1e45979a73464fdd1fb2 to your computer and use it in GitHub Desktop.
Save dawehner/1e45979a73464fdd1fb2 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Problem"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Today I stumpled upon a pretty interesting plot. Let's see whether we can figure out the x scaling, as it is pretty obviously not linear."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtgAAAEeCAYAAACwimIxAAAQsUlEQVR42u3deW8UZ4LA4fke81FW\n+99qRspuNNEk0o6WDWI1CwQILGAOgzEYQziMgXAGGAhHOAcIdwjhCHECZJKZkAwEwk0I4R4OHxgH\nm3f91tAV44Bpu91tMM8rPVLUXVVdbtPlX0pvV/3q337fM7xo+gwpCROmzwtFYydnvc6O3ftDHGOn\nvP3I4//5x4FhzKQZoXzanNCzX1GH9mfAiLJk/SFj3ur27/3oiZWJjq7ff/jY5Hc3sHh8u9b73/8b\nlbzHxeXTnpv3Ku5vHOs27Xjuf+8lE6eHkeMr8vo7z+dntKX4OS2rmJ1styvf045+FjL6DRubvCfx\ns5GP/XseP3MtDW3+PY+bOqtbH4/jv+H4O2rP38LW68fPwsDi8pz3I25n0Kjy5/oz2fpv3fjm9/bN\nkWUd3kbp5JnJdl55/Y1O379hw18Kc6f/a1g0619C2djfhJ69f9/hbY0Y8VIoGvbvOe3PKz3+EEpK\nfhv6D/pd3n4ng4f+Rxg75rehd/9XCvJv4FcvYmB3xJP+eEO+LF29Ifk3N2/JSu+HzygAzxGB7Y83\nz6gTp88l/+Y646yrzyjAi+XW17+mCwlsf7wpkBnvvBsq5y3OatlREyqTf28nTp313vmMAghsge2P\nN7QW5x9nxsZtu9pctm9Rabh9pzrU1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0AENgCGwrm3IWLoeXId/AW+vUA\nQGALbCiIYWMnh+qamiRyb92pDjW1dXkN3kK/HgAIbIENBTN38YrQ2NiYBO7pc98nj128dDlvwVvo\n1wMAgS2woWBWrt+STs+oOvhF+ni+grfQrwcAAltgQ0H1LSoN9fX3wvK17z/yeL6Ct9CvBwACW2DD\nM6HQwSuwARDYAhsEtsAGAIENCGwAENgCGwQ2AAhsgQ0CW2ADgMCGLlQ+bY7AFtgACGyBDZ1l5frN\nAltgAyCwBTZ0lj2fHBDYAhsAgS2wobN88dU3AltgAyCwBTYIbIENAAIbBLbABgCBLbAR2AIbAAS2\nwAaBLbABQGCDwBbYACCwBTYCW2ADgMAW2CCwBTYAAltgg8Bu4ZXX3wjVNTWhqelBmP/uKoENAAIb\nBHYuwRujOjNOnT0vsAFAYIPAzjV4b92+ExobG8OcP60Q2AAgsAEAQGALbAAABLbABgAAgQ0AAAIb\nAAAEtsAGAEBgC2wAABDYAAAgsAU2AAACW2ADAIDABgAAgS2wAQAQ2AIbAACBLbABAEBgAwCAwBbY\nAAAIbIENAAACGwAABLbABgBAYAtsAAAENgAAILABAEBgAwCAwAYAAAQ2AAAIbAAAENgAACCwvREA\nACCwAQBAYAMAgMAGAAAENgAACGwAABDYAACAwAYAAIENAAACGwAABDYAACCwAQBAYAMAgMAGAAAE\nNgAACGwAABDYAAAgsAEAAIENAAACGwAABDYAACCwAQBAYAMAgMAGAACBDQAACGwAABDYAAAgsAEA\nAIENAAACGwAABDYAAAhsbwIAAAhsAAAQ2AAAILABAICs/T/WgNX7aoATLwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import Image\n",
"Image(filename='data.png')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As we see, this is obviously not trivial. It is certainly not linear, but maybe logarithmic or a quite high polynomial might work. First though let's try to extract the size of the bars using scikit-image."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Read in the data"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from skimage import data, io, filters, measure"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"data = io.imread('data.png', as_grey=True)\n",
"# Strip the top out\n",
"data = data[20:,]"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(266, 728)"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.shape"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"contours = measure.find_contours(data, 0.8)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from scipy.optimize import curve_fit"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data extraction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Split up the images up manually. We could use some fancy algorithm, but this seems easier. After then look at an individual line through the dataset."
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAA9CAYAAABWdClAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACDtJREFUeJzt3W+MVFcZx/Hvj64lIpGCLdCAMG0I1poqNooxtJZYpfgn\nUGNi0KTRJvVPYmLjCwvUF4QXJvBGY6IvrK3YoBW1WoupSSlpV62xFi0rG/6bZpDSstjYP9Iapfr4\n4pxph3GB2Zm5e2cuv0+y2btnZ3afh9l9uHvOuc9VRGBmZtUypewAzMys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SrqUCr102BFwNfDvn+BKwjh7mV2RxP0a6JV/D/DxWBWOS5gC03D/2GGlraEPf5yxp\niFTYt0ZE41qFyuTXEBEvknpPv3r/Xxjo/JYBqyQ9CfwIeH/u1nq8ArkBEBHP5Pd/A35BmoaowmsH\naSbjaET8MX/8M1Kx71l+RRb3XcAiSQslXQisIV34NIhabynYuIALTr+AazuwRtKF+fqARcDjkxVk\nh74H7IuIbzaNVSI/SRc3dhtIej3wQdK6wsDnFxG3R8SCiLic9Lv1cKRurb9kwHODdPFk/osSvXbx\n5CgVeO0A8tTLUUmN/lzXA3vpZX4FrwavJO3AOAysK3t1usMc7iH1q/8XqfXxzaSOmDtzbjuAi5oe\nv560kr0fWFF2/OfIbRmpGdwIaSX+ifyazapIflflnEaAPcBX83gl8muK+Tpe2y1TidxIc9KNn8vR\nRv2oSn453neQToJHgJ+Tdsv0LD9fxGRmVkFeUDUzqyAXdzOzCnJxNzOrIBd3M7MKcnE3M6sgF3cz\nswpycTczqyAXdzOzCvofbaX0cx4at6oAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1146d5950>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAACdCAYAAAB/5CmPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAC6hJREFUeJzt3W+sZPVdx/H3Z0EqLS1/ooDtCrNISpGowIPVSoirFEpp\nAn2EtE1TSnxWLbGmKeADnlYT05BoH5hSQkhbWqnINiF2u9ls02rQbQDZ8t/Q2cLSvWiKKJoQ/nx9\nMGdx9nIve+69c+fMT96v5IYzv5nd82G498O5Z87MN1WFJKkNW4YOIEnqz9KWpIZY2pLUEEtbkhpi\naUtSQyxtSWrIhko7yeVJHkvyRJLPzyqUJGllWe912km2AE8AlwDPAvuAa6rqsdnFkyRN28iR9nbg\nyao6UFUvA3cCV80mliRpJcdu4M++B3h66vYzTIr8CEl8y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FiznM0yOYH7Y3f4WkxJftOfz\nA8BTVfWzqnoVuBv4bRYv52Gr5ToI/PLU4wb/2UpyLZPTeB+bWl6knL8CjIB/SfLjLsv9SU5lwbtq\nuc0s7X3A2UnOTHIccA2wcxP3t1ZfAR6pqlum1nYC13bbnwTuWf6H5qmqbqqqM6rqLCbP356q+gTw\nbRYr5xLwdJL3dkuXAA+zYM8nk9Miv5Xk57sXmi5h8gLvouQMR/5GtVquncA13ZUv24CzgX+eV0iW\n5UxyOZNTeFdW1UtTj1uYnFX1o6o6varOqqptTA40Lqiq57qcvz9gzrWpqk37Ai4HHmdyYv+GzdzX\nGnNdBLwKPAg8ANzfZT0F2N1l3gWcNHTWqcy/A+zsthcuJ5MrRvZ1z+nfAicuaM6bmbzw/BCTF/d+\nbhFyAl8DngVeYvI/l08BJ6+Wi8kVGv/a/btcNnDOJ5lcjXF/9/WlRcy57P6ngFOGzrmeLz97RJIa\n8pZ+IVKSWmNpS1JDLG1JaoilLUkNsbQlqSGWtiQ1xNKWpIb8L+0ZAvUD5N+BAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x117385cd0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAVcAAAD+CAYAAACOVUaKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADH1JREFUeJzt21+IXPd5h/Hnq4oGu0lVt0FSycaehhClmBLbULXBlCqx\n3TgOxL4KTkuwE3qXEkMgWHYvTO+cq2Bob0odIwxpm6alUiCtZSFW0AanCpZqYVtyaLOOlETrlpQG\nN2CS+O3FHqcrdVc7++fdmZGfDxz2nN+e3XkZVo/OnN1JVSFJ2lo7Jj2AJF2NjKskNTCuktTAuEpS\nA+MqSQ2MqyQ12FRck9yZ5GySl5I8uFVDSdKsy0b/zjXJDuAl4Dbge8BJ4N6qOrt140nSbNrMlet+\n4FtV9XJV/Rj4K+DurRlLkmb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W1f1ib5pkfA75WVb8OvA84y3TPO56qat2A3wb+YdnxQeDB7sfd4Kw3AM8tOz4L7Bn29wJnJz3j\nFWb/e+D2WZgZuBb4JvCb0z4vMAc8DRwAjszCzwXwbeBXLlubypmBXwT+bYX1qZx3Pdt23BZ4B3B+\n2fGFYW0W7K6qRYCqugjsnvA8K0oyYulq8BmWfiCncubh5fUp4CLwdFWdZIrnHXwB+Bxc8va3aZ+5\ngKeTnEzyh8PatM78a8B/JnliuPXy50muZXrnHZu/0Fqfqfu7tSRvBb4CPFBVr/L/Z5yamavq9Vq6\nLTAH7E9yI1M8b5KPAItVdRpY8W8ZB1Mz8+DWqroFuIul20W/w/Q+zzuBW4A/G2b+H5Ze3U7rvGPb\njrh+F7h+2fHcsDYLFpPsAUiyF3hlwvNcIslOlsL6ZFUdHpanemaAqvohMA/cyXTPeyvw0ST/Dvwl\n8MEkTwIXp3hmqur7w8f/YOl20X6m93m+AJyvqm8Ox3/LUmyndd6xbUdcTwLvTnJDkp8H7gWObMPj\nbkS49ArlCHD/sH8fcPjyL5iwLwIvVNVjy9amcuYkb3/jN75JrgHuAF5kSucFqKqHq+r6qnoXSz+3\nx6vqE8BXmdKZk1w7vJohyS8AvwecYUqf5+Gl//kk7xmWbgOeZ0rnXZdtuml9J3AO+BZwcNI3mleZ\n8UvA94DXgO8AnwSuA44Nsx8FfmnScy6b91bgp8Bp4BTw7PA8//I0zgz8xjDjaeA54I+H9amcd4X5\nf5f/+4XW1M7M0j3MN34mzrzx723KZ34fSxdhp4G/A3ZN87zjbr79VZIa+AstSWpgXCWpgXGVpAbG\nVZIaGFdJamBcJamBcZWkBsZVkhr8Lxl7pm5bfs3xAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1168ec5d0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"d1 = data[0:50,0:600]\n",
"plt.imshow(d1)\n",
"plt.show()\n",
"\n",
"d2 = data[90:150,0:160]\n",
"plt.imshow(d2)\n",
"plt.show()\n",
"\n",
"\n",
"d3 = data[170:220,0:70]\n",
"plt.imshow(d3)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we print out an individual line of the dataset, this gives us an idea how to extract an exact line of the data."
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFq9JREFUeJzt3X+sZPV53/H35+6aGHCCITRYZrM4DjK/FGEjB6dyIt+G\nFtaualBa1VAp9Y/+QJFprUhtMElV78qR6khum1rQClzioFgNakMCG1XBJHKmUapgrw0YSnbNxnbo\n7hrjYtfG1L+WvU//mHM3w+zuzNyZ2XvnnHm/pNXOnHtm5vu9C8997vN9zvekqpAkddfKVg9AknR6\nGeglqeMM9JLUcQZ6Seo4A70kdZyBXpI6bqJAn2RXkgNJnkpy60m+/sokv5vkc0keTnL5/IcqSZrG\n2ECfZAW4HbgOuAK4KcmlQ6f9MvBoVV0JvBP4yLwHKkmaziQZ/dXAwap6uqqOAvcC1w+dcznwSYCq\n+jzwmiR/ba4jlSRNZZJAfyFwaOD54ebYoM8BPweQ5GpgJ7BjHgOUJM1mXouxHwLOTfII8F7gUeDY\nnN5bkjSD7ROcc4R+hr5uR3PsuKr6FvCe9edJvgR8cfiNkrixjiRNoaoy7Wsnyej3ARcnuSjJGcCN\nwN7BE5Kck+RlzeN/AvyPqnrhFIPt7J8PfOADWz4G5+f8lm1uyzC/WY3N6KvqWJJbgIfo/2C4u6r2\nJ7m5/+W6C7gMuCfJGvAk8I9mHpkkaS4mKd1QVQ8Clwwdu3Pg8cPDX5ckLQavjJ2j1dXVrR7CaeX8\n2qvLc4Puz29WmUf9Z+IPS2ozP0+SuiAJdZoXYyVJLWagl6SOM9BLUscZ6CWp4yZqr9xszz4Ll14K\n3//+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c8l+VhTersryVnMcX4LuU1xy7V6dTvJK4DfAd7XZPbD82nt/Kpq\nrareQP83lauTXEEH5pfkbwPPNr+RjWphbt3cBry5qq6i/1vLe5P8DB34t2tsB64C7mjm+P+A9zPH\n+W1WoD8C7Bx4vqM51gXPJrkAIMmrgK82x48APzpw3sLPOcl2+kH+t6pqfQPVzsxvXVU9D/SAXXRj\nfm8G3p7ki8BvAz+b5LeAr3RgbgBU1TPN3/8HuJ9+qaIL/3bQr3AcqqrPNM/vox/45za/zQr0xy+6\nSnIG/Yuu9m7SZ89beGnWtBd4V/P4ncADA8dvTHJGkh8DLgZO3Fd4sfwG8OdV9R8GjnVifknOX+9a\nSHIm8Lfor0O0fn5V9ctVtbOqXkv//61PVtXP09936l3Naa2cG/R3x21+0yTJ2cC1wBN04N8OoCnP\nHEryuubQNcCTzHN+m7iqvIt+J8dB4P1bvco95Rz+C/2tmr8H/G/g3cC5wB81c3sIeOXA+bfRXxHf\nD1y71eMfM7c3A8fod0Q9CjzS/Jud15H5/UQzp8eAx4FfaY53Yn4DY34Lf9V104m50a9hr/93+cR6\n/OjK/JrxXkk/IX4M+F36XTdzm58XTElSx7kYK0kdZ6CXpI4z0EtSxxnoJanjDPSS1HEGeknqOAO9\nJHWcgV6SOu7/A34pvYYZQE/xAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x116a28cd0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(d1[25,])\n",
"plt.plot(d2[30,])\n",
"plt.plot(d3[30,])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to extract a single line lenght, we just check how long a single line is over 0.5 and then sums up the boolean values. This gives us the effective X length of the individual bar."
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"560 130 24\n"
]
}
],
"source": [
"len1 = np.sum(d1[25,] > 0.5)\n",
"len2 = np.sum(d2[30,] > 0.5)\n",
"len3 = np.sum(d3[30,] > 0.5)\n",
"\n",
"points = np.array([[len1, 65.2], [len2, 1.5], [len3, 1.1]])\n",
"print len1, len2, len3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Finding the right model/scaling"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ -2.18158824e-12 1.00000000e+00] [[ inf inf]\n",
" [ inf inf]]\n",
"[ -1.89337435e-12 1.00000000e+00 -2.02977291e-12] [[ inf inf inf]\n",
" [ inf inf inf]\n",
" [ inf inf inf]]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/dawehner/anaconda/lib/python2.7/site-packages/scipy/optimize/minpack.py:690: OptimizeWarning: Covariance of the parameters could not be estimated\n",
" category=OptimizeWarning)\n"
]
}
],
"source": [
"linear = lambda x, a, b: a + b * x\n",
"square = lambda x, a, b, c: a + b * x + c * x **2\n",
"\n",
"popt, pcov = curve_fit(linear, points[:,0], points[:,0])\n",
"print popt, pcov\n",
"\n",
"popt, pcov = curve_fit(square, points[:,0], points[:,0])\n",
"print popt, pcov"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"mh, this didn't out worked so well, so let's try logarithmic"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[-0.33248244 0.00794913] [[ 1.00585771e-01 -2.16923734e-04]\n",
" [ -2.16923734e-04 9.11444246e-07]]\n"
]
}
],
"source": [
"points2 = np.log(points[:,1])\n",
"popt, pcov = curve_fit(linear, points[:,0], points2)\n",
"print popt, pcov"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lovely!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\n",
"\\begin{equation}\n",
"a + b x = \\log(y) <=> \\\\\n",
"\\exp(a + bx) = y <=>\\\\\n",
"\\exp(a) \\exp(bx) = y => \\\\\n",
"0.71 \\exp(0.0079 \\; x) = y\n",
"\\end{equation}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Summary"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This plot was fun to read. The resulting xscale is:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\n",
"\\begin{equation}\n",
"x' = 0.71 \\; e^{\\; 0.0079 x}\n",
"\\end{equation}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": 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.11"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment