Commit 58682f8e authored by Francesco Zappa's avatar Francesco Zappa

py version and jupyter versions ready

parent dc1f4ec6
This diff is collapsed.
......@@ -13,12 +13,6 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"TODO: \n",
"- add ceil values for max mass/spin\n",
"- check limi\n",
"- verify/debug\n",
"\n",
"\n",
"PYTHON IMPLEMENTATION FOR THE REMNANT BLACK HOLE OF BH-NS MERGERS\n",
"from XXX\n",
"(c) Francesco Zappa, Sebastiano Bernuzzi\n",
......@@ -32,7 +26,6 @@
" * https://arxiv.org/abs/1612.09566\n",
"\n",
"\n",
"\n",
" \n",
"BBH final-sTate fitting formulas from https://arxiv.org/abs/1611.00332\n",
"(c) 2016-2017 Xisco Jimenez-Forteza, David Keitel, Sascha Husa, Mark Hannam, Sebastian Khan, Michael Puerrer\n",
......@@ -570,12 +563,12 @@
" ## 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 = model3a(nu, chi1, lam, spinc)\n",
" model[model > 1] = 1\n",
" model[mask1] = 1\n",
" model[mask2] = 1\n",
"\n",
" return bbh_final_spin_non_precessing_UIB2016(m1, m2, chi1, 0.)*model3a(nu, chi1, lam, spinc), final_angle(m1, chi1, beta, momega_0)\n",
" return bbh_final_spin_non_precessing_UIB2016(m1, m2, chi1, 0.)*model, final_angle(m1, chi1, beta, momega_0)\n",
"\n",
"def BHNS_spin_aligned(m1, m2, chi1, lam):\n",
" \"\"\"\n",
......@@ -661,34 +654,24 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[4.08319483 6.02286119 6.91767975]\n",
"[4.04789658 6.35220114 7.30659329]\n"
]
},
{
"ename": "ValueError",
"evalue": "chi1 has to be in [0, 1], for spin below the orbital plane specify 90 < beta < 180.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-83917f3463d5>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mBHNS_mass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchi1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlam\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mBHNS_mass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchi1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlam\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m80.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m80.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m80.\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0;32mprint\u001b[0m \u001b[0mBHNS_spin_precessing\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchi1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlam\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m50.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m30.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m10.\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0.025\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.025\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.025\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 11\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mBHNS_luminosity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchi1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlam\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mBHNS_luminosity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchi1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlam\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m80.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m80.\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m80.\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m<ipython-input-3-680f111792c0>\u001b[0m in \u001b[0;36mBHNS_spin_precessing\u001b[0;34m(m1, m2, chi1, lam, beta, momega_0)\u001b[0m\n\u001b[1;32m 142\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"m2 must not be negative\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 143\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchi1\u001b[0m\u001b[0;34m>\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchi1\u001b[0m\u001b[0;34m<\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 144\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"chi1 has to be in [0, 1], for spin below the orbital plane specify 90 < beta < 180.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 145\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlam\u001b[0m\u001b[0;34m<\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 146\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Lambda must not be negative\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: chi1 has to be in [0, 1], for spin below the orbital plane specify 90 < beta < 180."
"[3.83408237 6.02286119 6.91767975]\n",
"[4.01880681 6.35220114 7.30659329]\n",
"(array([0.80178672, 0.8681759 , 0.90833044]), array([6.66613655, 5.43639423, 2.05333033]))\n",
"[1.06117197e-04 7.91427714e-05 1.07641419e-04]\n"
]
}
],
"source": [
"m1 = np.array([2.8, 5., 6.])\n",
"m2 = np.array([1.4, 1.6, 1.5])\n",
"chi1 = np.array([-0.9, 0.9, 0.9])\n",
"chi1 = np.array([0.9, 0.9, 0.9])\n",
"lam = np.array([500., 1000., 1000.])\n",
"\n",
"\n",
......@@ -696,8 +679,7 @@
"print BHNS_mass(m1, m2, chi1, lam)\n",
"print BHNS_mass(m1, m2, chi1, lam, np.array([80., 80., 80.]))\n",
"print BHNS_spin_precessing(m1, m2, chi1, lam, np.array([50., 30., 10.]), np.array([0.025, 0.025, 0.025]))\n",
"print BHNS_luminosity(m1, m2, chi1, lam)\n",
"print BHNS_luminosity(m1, m2, chi1, lam, np.array([80., 80., 80.]))"
"print BHNS_luminosity(m1, m2, chi1, lam)"
]
}
],
......
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