Commit a3b9d820 authored by Francesco Zappa's avatar Francesco Zappa

Added plot fig.1 to notebook

parent a5cdfb71
......@@ -499,14 +499,12 @@
" m, nu = m1m2_to_mnu(m1, m2)\n",
" \n",
" ## Enforce BBH values\n",
" mask1 = np.logical_and(chi1<0, nu<0.188)\n",
" mask2 = chi1<-0.5\n",
" model = model3a(nu, chi1, lam, massc)\n",
" model[model > 1] = 1\n",
" model[mask1] = 1\n",
" model[mask2] = 1\n",
" \n",
" return bbh_final_mass_non_precessing_UIB2016(m1, m2, chi1, 0.)[1]*model\n",
" aux = bbh_final_mass_non_precessing_UIB2016(m1, m2, chi1, 0.)[1]*model/m\n",
" \n",
" aux[aux > 1] = 1\n",
" return aux*m\n",
"\n",
"def BHNS_mass_aligned(m1, m2, chi1, lam):\n",
" \"\"\"\n",
......@@ -541,14 +539,12 @@
" m, nu = m1m2_to_mnu(m1, m2)\n",
"\n",
" ## Enforce BBH values\n",
" mask1 = np.logical_and(chi1<0, nu<0.188)\n",
" mask2 = chi1<-0.5\n",
" model = model3a(nu, chi1, lam, massc)\n",
" model[model > 1] = 1\n",
" model[mask1] = 1\n",
" model[mask2] = 1\n",
"\n",
" return bbh_final_mass_non_precessing_UIB2016(m1, m2, chi1, 0.)[1]*model\n",
" \n",
" aux = bbh_final_mass_non_precessing_UIB2016(m1, m2, chi1, 0.)[1]*model/m\n",
" \n",
" aux[aux > 1] = 1\n",
" return aux*m\n",
"\n",
"def final_angle(m1, chi1, beta, momega_0):\n",
" '''Compute approximate final angle for precessing spin using Keplerian formulas as\n",
......@@ -605,7 +601,6 @@
" mask1 = np.logical_and(chi1<0, nu<0.188)\n",
" mask2 = chi1<-0.5\n",
" model = model3a(nu, chi1, lam, spinc)\n",
" model[model > 1] = 1\n",
" model[mask1] = 1\n",
" model[mask2] = 1\n",
"\n",
......@@ -648,6 +643,7 @@
" model = model3a(nu, chi1, lam, spinc)\n",
" model[mask1] = 1\n",
" model[mask2] = 1\n",
"\n",
" \n",
" return bbh_final_spin_non_precessing_UIB2016(m1, m2, chi1, 0.)*model\n",
"\n",
......@@ -695,7 +691,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
......@@ -705,7 +701,7 @@
"[3.83408237 6.02286119 6.91767975]\n",
"[4.01880681 6.35220114 7.30659329]\n",
"[0.94431687 0.92332301 0.91443582]\n",
"(array([0.67288684, 0.60139493, 0.54997457]), array([2.55650024, 2.55650024, 2.55650024]))\n",
"(array([0.72248797, 0.60494449, 0.54997457]), array([2.55650024, 2.55650024, 2.55650024]))\n",
"[1.06117197e-04 7.91427714e-05 1.07641419e-04]\n"
]
}
......@@ -735,12 +731,107 @@
"print BHNS_luminosity(m1, m2, chi1, lam)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Compute Figure 1 of arxiv:XXXYYYY"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import pylab\n",
"import matplotlib\n",
"import matplotlib.lines as mlines\n",
"from matplotlib import cm\n",
"from matplotlib.ticker import FormatStrFormatter\n",
"from matplotlib import ticker"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"params = {'text.usetex': True}\n",
"pylab.rcParams.update(params)\n",
"matplotlib.rcParams['figure.figsize'] = (26, 5)\n",
"matplotlib.rcParams['figure.titlesize'] = 20\n",
"matplotlib.rcParams['figure.subplot.wspace'] = 0.2\n",
"matplotlib.rcParams['figure.subplot.hspace'] = 0.2\n",
"matplotlib.rcParams['font.family'] = 'serif'\n",
"matplotlib.rcParams['font.serif'] = 'Computer Modern Roman'\n",
"matplotlib.rcParams['xtick.labelsize'] = 20.0\n",
"matplotlib.rcParams['ytick.labelsize'] = 20.0\n",
"matplotlib.rcParams['axes.labelsize'] = 20.0\n",
"matplotlib.rcParams['legend.fontsize'] = 17.0\n",
"matplotlib.rcParams['legend.borderpad'] = 0.1\n",
"matplotlib.rcParams['legend.loc'] = 'best'\n",
"matplotlib.rcParams['legend.borderaxespad'] = 0.2\n",
"matplotlib.rcParams['legend.fancybox'] = True\n",
"matplotlib.rcParams['axes.titlesize'] = 20.0\n",
"matplotlib.rcParams['axes.labelpad'] = 15.\n",
"matplotlib.rcParams['axes.titlepad'] = 20."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"nu = np.arange(0.0001, 0.25, 0.001)\n",
"nu = nu[::-1]\n",
"Lambda = np.arange(0, 2500, 1)\n",
"nu, Lambda = np.meshgrid(nu, Lambda)\n",
"ai = np.array([-0.5, 0., 0.5, 0.75])\n",
"M_NS = 1.35\n",
"M_BH = M_NS * (1-2*nu + np.sqrt(1-4*nu))/(2*nu)\n",
"M = M_BH + M_NS\n",
"\n",
"fig, ax = plt.subplots(2, 4, sharey=True, sharex=True, figsize=(12,12))\n",
"fig.subplots_adjust(wspace=0, hspace=0.05, bottom=0.13, top = 0.91, left = 0.1)\n",
"\n",
"for i, a in enumerate(ai):\n",
" ax[0,i].set_ylim(0,2500)\n",
" \n",
" X_f = BHNS_mass_aligned(M_BH, M_NS, a, Lambda)/M\n",
" \n",
" ax[0,i].set_title(r'$a_{\\rm BH} = %-.2f$' % (a))\n",
" clev = np.arange(0.88, 1.01, 0.01)\n",
" wframe = ax[0,i].contourf(nu, Lambda, X_f, clev, cmap = cm.viridis)\n",
" CS = ax[0,i].contour(nu, Lambda, X_f, clev, colors = 'k')\n",
" labs = ax[0,i].clabel(CS, colors='k', fmt='%.2f', fontsize=15)\n",
" ax[0,i].set_xticks(np.arange(0,0.3, 0.05))\n",
" ax[0,i].set_yticks(np.arange(0,2500,500), minor=True)\n",
" ax[0,i].xaxis.set_major_formatter(FormatStrFormatter('%.2g'))\n",
"ax[0,0].set_ylabel(r'$\\Lambda$')\n",
"cbar_ax = fig.add_axes([0.925, 0.53, 0.02, 0.35])\n",
"cb = fig.colorbar(wframe, cax=cbar_ax)\n",
"cb.ax.set_title(r'$X_{\\bullet}$', y=0.9)\n",
"\n",
"for i, a in enumerate(ai):\n",
" ax[1,i].set_xlabel(r'$\\nu$')\n",
" a_f = BHNS_spin_aligned(M_BH, M_NS, a, Lambda)\n",
" clev = np.arange(-1.0, 1.1, 0.1)\n",
" wframe = ax[1,i].contourf(nu, Lambda, a_f, clev, cmap = cm.viridis)\n",
" CS = ax[1,i].contour(nu, Lambda, a_f, clev, colors = 'k')\n",
" labs = ax[1,i].clabel(CS, colors='k', fmt='%.1f', fontsize=15)\n",
" ax[1,i].set_xticks(np.arange(0,0.3, 0.05))\n",
" ax[1,i].set_yticks(np.arange(0,2500,500), minor=True)\n",
" ax[1,i].xaxis.set_major_formatter(FormatStrFormatter('%.2g'))\n",
"ax[1,0].set_ylabel(r'$\\Lambda$')\n",
"fig.subplots_adjust(right=0.915, bottom = 0.21, top = 0.8, left = 0.1)\n",
"cbar_ax = fig.add_axes([0.925, 0.12, 0.02, 0.35])\n",
"cb = fig.colorbar(wframe, cax=cbar_ax, ticks = np.arange(-1.0,1.4,0.4))\n",
"cb.ax.set_title(r'$a_{\\bullet}$', y=0.9)"
]
}
],
"metadata": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment