Cutoff_energy.ipynb 17.6 KB
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Beware this code take time to run!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.01        0.01217357  0.01481958  0.01804072  0.021962    0.0267356\n",
      "  0.03254677  0.03962104  0.04823295  0.05871672  0.07147921  0.08701572\n",
      "  0.1059292   0.12895366  0.15698264  0.19110393  0.23264171  0.28320803\n",
      "  0.34476529  0.41970246  0.51092774  0.62198149  0.75717355  0.92175056\n",
      "  1.12209954  1.36599578  1.66290459  2.02434862  2.46435506  3.        ] [ 19199.20665593  17508.27031736  15966.26022101  14426.43951218\n",
      "  12796.96868216  10940.54707206   8932.04599858   6836.51600451\n",
      "   4771.76094894   2954.40799888   1607.70442167   1091.53593533\n",
      "    835.45280584    675.81811682    562.01738481    471.70846909\n",
      "    399.57803019    338.47728559    284.08836902    234.08272762\n",
      "    182.49932448    161.88596902    139.6835118     117.23818033\n",
      "    102.09606623     94.83681866     87.28526624     82.58799388\n",
      "     92.24970053    102.09606623]\n"
     ]
    }
   ],
   "source": [
    "from modules.analytic import distance, lambda_gg\n",
    "from numpy import logspace, log10, shape, zeros, nditer\n",
    "\n",
    "z_tab=logspace(-2,log10(3),num=30)\n",
    "E_save=zeros(shape(z_tab)[0])\n",
    "it=nditer(E_save, op_flags=['writeonly'])\n",
    "\n",
    "for z in z_tab:\n",
    "    diff_save=1e5\n",
    "    for E in logspace(1,5,num=1000):\n",
    "        diff = abs(lambda_gg(E,z)[0]-distance(z)[1])     \n",
    "        if diff < diff_save:\n",
    "            it[0] = E\n",
    "            diff_save = diff\n",
    "    it.iternext()\n",
    "    \n",
    "print z_tab, E_save    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  1.91992047e+04  -1.00002070e+00]\n"
     ]
    }
   ],
   "source": [
    "from numpy.random import normal\n",
    "from scipy.optimize import curve_fit\n",
    "\n",
    "def Ecut(z,E0,alpha):\n",
    "    return E0*(z/1e-2)**alpha\n",
    "\n",
    "E_approx=Ecut(z_tab,E_save[0],-1) + 0.2 * normal(size=len(z_tab))\n",
    "\n",
    "param, pcov = curve_fit(Ecut, z_tab, E_approx)\n",
    "\n",
    "print param"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEWCAYAAAB1xKBvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcFdWZ//HPwy6iEvdE2gFFwG3E6OASlxZHZYxrDEaI\nUYyimFETVNSJUZpR4xK3KKMGHUSTAC4xETHueB2MMS4IGlkElfwaTVCjKIsgy/P749yGFunuuktV\n3er7fb9e9yVVt27VgWPfp895zmLujoiISEvapF0AERHJBgUMERGJRAFDREQiUcAQEZFIFDBERCQS\nBQwREYlEAUNERCJRwBARkUgqKmCYWa2ZTTWz283s4LTLIyIi61RUwADWAIuBjsCClMsiIiKNxB4w\nzGysmS00szfWOz/AzGab2Vwzuzh/eqq7HwlcAoyKu2wiIhJdEi2Mu4EBjU+YWVtgdP78LsAgM9vZ\n1y1stYjQyhARkQrRLu4HuPtUM+u+3ul+wDx3nw9gZhOBY82sD3AE0BW4Ne6yiYhIdLEHjCZsB9Q3\nOl4A7OPu1wC/b+nDZqYldkVEiuDuVuxn00p6l/yF7+6pv0aOHJn6vQr5XJRrm7um0Peaur6c/26V\nUHeVUn/Fvl/I+Uqou3KXoxLqrqVrinlvQ+dLlVbAeA+oaXRcQ4Gjourq6sjlcuUsU8Fqa2tTv1ch\nn4tybXPXFPpeU9fPnz+/xXLErZx1V8r9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uvrw8fzWR0mk/DBERiURdUiIi\nEokChoiIRKKAISIikShgiIhIJAoYIiISiQKGiIhEooAhIiKR/H8KlBdMSMD06wAAAABJRU5ErkJg\ngg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6ae6708150>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib.pyplot import figure, show\n",
    "%matplotlib inline\n",
    "fig = figure()   \n",
    "ax1 = fig.add_subplot(111)\n",
    "ax1.plot(z_tab,E_save,drawstyle='-')\n",
    "ax1.plot(z_tab,Ecut(z_tab,param[0],param[1]),\"r--\")\n",
    "ax1.set_xscale('log')   \n",
    "ax1.set_yscale('log')\n",
    "ax1.grid(b=True,which='major')\n",
    "ax1.set_xlabel(\"redshift\")\n",
    "ax1.set_ylabel(\"cutoff energy [GeV]\")\n",
    "show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$E_{cut}(z) \\simeq 2.10^4 \\left(\\frac{z}{10^{-2}}\\right)^{-1} \\textrm{ GeV}$$ \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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}