Commit 4e99b883 authored by NUNEZ Arturo's avatar NUNEZ Arturo

Automatic commit mercredi 1 août 2018, 16:30:02 (UTC+0200)

parent 3b98370c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 4,
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"hide_input": false, "hide_input": false,
...@@ -77,12 +77,22 @@ ...@@ -77,12 +77,22 @@
"text": [ "text": [
"loading Dark matter..\n", "loading Dark matter..\n",
"loading Stars..\n", "loading Stars..\n",
"loading Gas..\n", "loading Gas..\n"
"| r_200 = 212.70\n", ]
"| Diagonal matrix computed \n", },
"| | 20, 0, 0|\n", {
"| D =| 0, 14, 0|\n", "ename": "LinAlgError",
"| | 0, 0, 4|\n" "evalue": "Array must not contain infs or NaNs",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mLinAlgError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-f763ddbd9374>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mmyhydro\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mwkbl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGalaxy_Hound\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhydro\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mmyhydro\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcenter_shift\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhydro\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mc_dm_com\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mmyhydro\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mr_virial\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m600\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2.5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/home/arturo/Documents/git/WKBL/wkbl/astro/galaxy_peeker.pyc\u001b[0m in \u001b[0;36mr_virial\u001b[0;34m(self, r_max, r_min, rotate, n, bins, quiet)\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mrotate\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;32mand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sts\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 84\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrotate_galaxy\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 85\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mredefine\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0mD\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatrix_T\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatrix_P\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtranspose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatrix_T\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/home/arturo/Documents/git/WKBL/wkbl/astro/galaxy_peeker.pyc\u001b[0m in \u001b[0;36mrotate_galaxy\u001b[0;34m(self, rmin, rmax)\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[0msecond\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maverage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpos_ring\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\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[0maverage\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpos_ring\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mj\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[1;32m 121\u001b[0m \u001b[0mP\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfirst\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0msecond\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 122\u001b[0;31m \u001b[0meigen_values\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mevecs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlinalg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meig\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mP\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 123\u001b[0m \u001b[0morder\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margsort\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mabs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meigen_values\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 124\u001b[0m \u001b[0mT\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mzeros\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python2.7/dist-packages/numpy/linalg/linalg.pyc\u001b[0m in \u001b[0;36meig\u001b[0;34m(a)\u001b[0m\n\u001b[1;32m 1141\u001b[0m \u001b[0m_assertRankAtLeast2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1142\u001b[0m \u001b[0m_assertNdSquareness\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1143\u001b[0;31m \u001b[0m_assertFinite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1144\u001b[0m \u001b[0mt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresult_t\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_commonType\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1145\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python2.7/dist-packages/numpy/linalg/linalg.pyc\u001b[0m in \u001b[0;36m_assertFinite\u001b[0;34m(*arrays)\u001b[0m\n\u001b[1;32m 214\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0ma\u001b[0m \u001b[0;32min\u001b[0m \u001b[0marrays\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 215\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0misfinite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mall\u001b[0m\u001b[0;34m(\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--> 216\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mLinAlgError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Array must not contain infs or NaNs\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 217\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_isEmpty2d\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mLinAlgError\u001b[0m: Array must not contain infs or NaNs"
] ]
} }
], ],
...@@ -90,25 +100,16 @@ ...@@ -90,25 +100,16 @@
"hydro = wkbl.astro.halo_info.AdicoraHydro() \n", "hydro = wkbl.astro.halo_info.AdicoraHydro() \n",
"myhydro = wkbl.Galaxy_Hound(hydro.path)\n", "myhydro = wkbl.Galaxy_Hound(hydro.path)\n",
"myhydro.center_shift(hydro.c_dm_com)\n", "myhydro.center_shift(hydro.c_dm_com)\n",
"myhydro.r_virial(600,n=25)\n" "myhydro.r_virial(600,n=2.5)\n"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": null,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"/data/OWN/SF1test/SF0/mstar1_T3600/output_00041\n",
"[20418.88714 17567.72033 17124.40448]\n"
]
}
],
"source": [ "source": [
"print hydro.path\n", "print hydro.path\n",
"print hydro.c_dm_com" "print hydro.c_dm_com"
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": null,
"metadata": { "metadata": {
"collapsed": true "collapsed": true
}, },
...@@ -132,31 +133,12 @@ ...@@ -132,31 +133,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": null,
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"scrolled": true "scrolled": true
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"8.215e+11\n",
"1.175e+11\n"
]
},
{
"data": {
"text/plain": [
"0.281102"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [ "source": [
"print \"{0:.3e}\".format(np.sum(myhydro.dm.mass[myhydro.dm.r<myhydro.r200]))\n", "print \"{0:.3e}\".format(np.sum(myhydro.dm.mass[myhydro.dm.r<myhydro.r200]))\n",
"print \"{0:.3e}\".format(np.sum(myhydro.st.mass[myhydro.st.r<myhydro.r200]))\n", "print \"{0:.3e}\".format(np.sum(myhydro.st.mass[myhydro.st.r<myhydro.r200]))\n",
...@@ -5203,7 +5185,7 @@ ...@@ -5203,7 +5185,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 5,
"metadata": { "metadata": {
"collapsed": true "collapsed": true
}, },
...@@ -5214,7 +5196,7 @@ ...@@ -5214,7 +5196,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 6,
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"hide_input": false "hide_input": false
...@@ -5245,7 +5227,7 @@ ...@@ -5245,7 +5227,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 7,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
...@@ -5256,7 +5238,7 @@ ...@@ -5256,7 +5238,7 @@
"0.308899998664856" "0.308899998664856"
] ]
}, },
"execution_count": 14, "execution_count": 7,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -5267,7 +5249,7 @@ ...@@ -5267,7 +5249,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 10,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
...@@ -5275,21 +5257,21 @@ ...@@ -5275,21 +5257,21 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"275.9765625" "205.6640625"
] ]
}, },
"execution_count": 15, "execution_count": 10,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
], ],
"source": [ "source": [
"myDMO.r97" "myDMO.r200"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 16, "execution_count": 9,
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"hide_input": false "hide_input": false
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 7,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
...@@ -113,14 +113,14 @@ ...@@ -113,14 +113,14 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"With Delta_x = 282.287597656 as in Roskar 2013 we reproduce the value for p_j = n_h = 1.14430137115\n", "With Delta_x = 35.285949707 as in Roskar 2013 we reproduce the value for p_j = n_h = 18.3080473755\n",
"and Teq = 4674.11932418\n" "and Teq = 1168.55454942\n"
] ]
} }
], ],
"source": [ "source": [
"# reproducing Roskar 2013\n", "# reproducing Roskar 2013\n",
"levelmax = 17\n", "levelmax = 20\n",
"Delta_x = (37e6 / 2.**levelmax)\n", "Delta_x = (37e6 / 2.**levelmax)\n",
"\n", "\n",
"n_h, aux=5., 20.\n", "n_h, aux=5., 20.\n",
......
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