{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Calculate angular Cl's with CCL\n",
    "In this example, we will calculate the lensing angular power spectrum for an example cosmology."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pylab as plt\n",
    "import pyccl as ccl\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "### Set up a Cosmology object\n",
    "We begin by creating a new `Cosmology` object with a set of cosmology parameters:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "cosmo = ccl.Cosmology(Omega_c=0.27, Omega_b=0.045, h=0.67, A_s=2.1e-9, n_s=0.96)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "### Define a source number density\n",
    "The angular power spectrum is weighted by the source number density as a function of redshift, dN/dz. We define an example here."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "z = np.linspace(0., 3., 200)\n",
    "i_lim = 26. # Limiting i-band magnitude\n",
    "z0 = 0.0417*i_lim - 0.744\n",
    "\n",
    "Ngal = 46. * 100.31 * (i_lim - 25.) # Normalisation, galaxies/arcmin^2\n",
    "pz = 1./(2.*z0) * (z / z0)**2. * np.exp(-z/z0) # Redshift distribution, p(z)\n",
    "dNdz = Ngal * pz # Number density distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEACAYAA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+dr1w7oFW3vSmiPK6T/92pzfnl7/aL4d47+bQIsAL7fkOsXRwmgNoPBBgNTAdx9IdDKzNpmN8x6\nq9VgNyAvh7i5+3PARzs4JJ+vXW3OD/L32pW7+5JoexPwJtChymF5e/1qeX6Qp9cPwN0/izabEX5s\nfljlkDpdvzgSQG0Gg1V3TKcMx5UutTk/Bw6PimizzKxn1qLLvHy+drVRENfOzLoQSjoLq7xUENdv\nB+eX19fPzBqZ2RKgApjv7qVVDqnT9ctqL6BIbVudq2bpfGmtrk2crwKd3f0zMxsITAe6ZzasrMrX\na1cbeX/tzGxX4GHgwuiX8n8cUuV5Xl2/Gs4vr6+fu28DepnZbsATZpZw92SVw2p9/eIoAawHOqc8\n70zIUjs6plO0Lx/UeH7u/s/Kopy7zwaamtnu2Qsxo/L52tUo36+dmTUF/gLc6+7Tqzkkr69fTeeX\n79evkrtvBB4HDqryUp2uXxwJ4G9ANzPrYmbNgFOAmVWOmQmcDl+NHv7Y3SuyG2a91Xh+ZtbWLExz\nZ2aHELrjVq3Ly1f5fO1qlM/XLor7TqDU3W/dzmF5e/1qc355fv3amFmraLsFcCywuMphdbp+Wa8C\n8u0MBjOzUdHrt7v7LDMbZGZlwKfAGdmOs75qc37AT4BfmNlW4DMgb2Y+MrNpQD+gjZmtBcYRejvl\n/bWDms+PPL52wBHAacDrZlZ547gS2BMK4vrVeH7k9/VrD0w1s0aEH+9/cvd5Dbl3aiCYiEiR0kKL\nIiJFSglARKRIKQGIiBQpJQARkSKlBCAiUqSUAEREipQSgIhIkVICEBEpUv8f9Untjz6nZQoAAAAA\nSUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x107a85a50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(z, dNdz)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "### Create ClTracer objects\n",
    "CCL manages auto- and cross-spectrum calculations through `ClTracer` objects. For the sake of this example we will define two separate tracers, but both will effectively be the same tracer (so we end up calculating the auto-spectrum)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "lens1 = ccl.ClTracerLensing(cosmo, False, z=z, n=dNdz)\n",
    "lens2 = ccl.ClTracerLensing(cosmo, False, n=(z, dNdz))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "The argument set to `False` in these statements specifies that we are ignoring intrinsic alignments.\n",
    "\n",
    "Note how there are two different ways of specifying the number density, `dNdz`. The first one specifies the `z` and `dNdz` arrays as separate arguments. This is useful if you need to specify several redshift functions that are gridded onto the _same_ `z` array. For example, if we wanted to include intrinsic alignments, we could have created the `ClTracer` object like so:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "bias_ia = np.ones(z.size) # Intrinsic alignment bias factor\n",
    "f_red = 0.5 * np.ones(z.size) # Fraction of red galaxies\n",
    "lens1_ia = ccl.ClTracerLensing(cosmo, True, z=z, n=dNdz, bias_ia=bias_ia, f_red=f_red)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "The redshift functions are often binned quite differently, so sharing the same `z` array doesn't make sense. Instead, you can specify each function as a tuple, of the form `(z_array, function_array)`. Each pair can be binned in redshift however you like, e.g."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "z_ia = np.linspace(0., 3., 5) # Only 5 redshift bins\n",
    "bias_ia2 = np.ones(z_ia.size)\n",
    "lens2_ia = ccl.ClTracerLensing(cosmo, True, n=(z, dNdz), bias_ia=(z_ia, bias_ia), f_red=(z, f_red))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "### Calculate the angular power spectrum\n",
    "We can now calculate the angular power spectrum for the tracer(s). Internally, the calculation will be performed up to some $\\ell_{\\rm max}$, which will be relatively slow when first run. If we call the `angular_cl` function again with a different $\\ell$ sampling, it will be quickly evaluated from a spline though."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "ell = np.arange(2, 100)\n",
    "cls = ccl.angular_cl(cosmo, lens1, lens2, ell)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEGCAYAAABvtY4XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH3pJREFUeJzt3XmYVNWZx/Hvy6YiKkEiLoCgIIosomzBhSIqmwY3jDga\nidFoYozrZDKiI2Si0YzRKCYR3AgaBY0ahQgqIRQIKEHoRlZFxYAimEhEARGh3/njFNJpu+nq7qq6\nVbd+n+e5T9dy69bb95FfH88951xzd0REJH7qRV2AiIhkhwJeRCSmFPAiIjGlgBcRiSkFvIhITCng\nRURiKmcBb2YPm9l6M1ucoeONNrOlZrbMzO7JxDFFROIkly34ccDATBzIzBLAsUCn1NbDzPpm4tgi\nInGRs4B395eBf5V/zcwON7OpZvaamc0ysw5pHm490AjYA9gLaAisy2jBIiIFLuo++PuBH7t7d+An\nwO/S+ZC7LwdeAj4A3gdecPc3slaliEgBahDVF5tZE+AbwB/NbOfLjVLvnQ38rJKPvefug8zsJKAf\ncAhgwDQze9HdZ2e/chGRwhBZwBP+7+Fjd+9W8Q13fwZ4Zjef7Q1MdfctAGY2lfDHQgEvIpKSVheN\nmdU3sxIzm1zF+6PNbKWZLTKzrwR2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LQF/mFm48xsoZk9YGZ7U4TnIjXa7k5gNSHYP3b3aRThuSinqt/9YEJ+7lRtluYi4Iv+\nKq6ZNQGeBq5290/Lv5e6zVXsz5GZnU4YSltCFctaFMu5IIxeOxb4nbsfC2ymQhdEsZwLMzscuAZo\nQwiwJmZ2Yfl9iuVcVCaN33235yUXAf8+0Krc81b8+1+hWDOzhoRwf9Tdn029vN7MDky9fxDwYVT1\n5VAfYEhqEtwE4Jtm9ijFeS7eA95z9/mp508RAn9dEZ6L7sBcd//I3bcDzwDfoDjPxU5V/ZuomKUt\nU69VKRcB/+VEKTNrRLhIMCkH3xs5MzPgIWCZu99d7q1JwPDU4+GEpR1izd1HuHsrd29LuIj2V3f/\nDsV5LtYBa8xs53IepwBLgckU2bkgXFzubWZ7pf69nEK4CF+M52Knqv5NTAKGmVkjM2sLtAf+ttsj\nuXvWN2AQ8AbhosANufjOfNiAEwj9zaVASWobCDQD/gK8CbwENI261hyfl77ApNTjojwXQFdgPrCI\n0Grdr4jPxX8R/sAtJlxUbFgs54Lwf7NrgW2Ea5UX7+53B0akcnQFMKC642uik4hITOmWfSIiMaWA\nFxGJKQW8iEhMKeBFRGJKAS8iElMKeBGRmFLAi4jElAJeRCSm/h/IwqZ+tdfzwAAAAABJRU5ErkJg\ngg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10eb93e50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(ell, cls)\n",
    "plt.show()"
   ]
  }
 ],
 "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
}
