Commit b7213edc authored by NUNEZ Arturo's avatar NUNEZ Arturo
Browse files

Automatic commit lundi 13 août 2018, 16:30:01 (UTC+0200)

parent 174605db
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -58,7 +58,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {
"collapsed": false
},
......@@ -69,7 +69,7 @@
"text": [
"loading Dark matter..\n",
"centering\n",
"done r200 = 227.9296875\n"
"done r200 = 205.6640625\n"
]
}
],
......@@ -89,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {
"collapsed": true
},
......@@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 5,
"metadata": {
"collapsed": false
},
......@@ -116,7 +116,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2E_kin = 3.0329e+16 m_sun kms² s⁻²\n"
"2E_kin = 2.4945e+16 m_sun kms² s⁻²\n"
]
}
],
......@@ -134,18 +134,20 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(array([], dtype=int64),)\n",
"first simplification from Shapiro2004\n",
" E_pot = -3.9727e+16 m_sun km² s⁻²\n"
"ename": "NameError",
"evalue": "name 'myG' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-046a68d97f3b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mm_i\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmass\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mr_sorted\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mr_i\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mr\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mr_sorted\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1e-2\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpctocm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;31m# in km\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mU\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mmyG\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mM_i\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mm_i\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mr_i\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mfi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwhere\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr_i\u001b[0m\u001b[0;34m<\u001b[0m\u001b[0;36m0.19\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mfi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'myG' is not defined"
]
}
],
......@@ -162,45 +164,29 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4.53758186497e-39\n"
]
}
],
"outputs": [],
"source": [
"print myGkpc"
]
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4.53758186497e-39\n"
]
}
],
"outputs": [],
"source": [
"print myGkpc"
]
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": null,
"metadata": {
"collapsed": true
},
......@@ -212,11 +198,23 @@
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'myGkpc' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-7-48d0e15a70bb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mpos\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[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpos3d\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreshape\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpos3d\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfloat32\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mok\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0macc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPhy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mCF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetGravity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpos\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmyDMO\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmass\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0.090\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mG\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmyGkpc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'myGkpc' is not defined"
]
}
],
"source": [
"pos = np.array(myDMO.dm.pos3d.reshape(len(myDMO.dm.pos3d)*3),dtype=np.float32)\n",
"ok, acc, Phy = CF.getGravity(pos,myDMO.dm.mass,0.090,G=myGkpc)"
......@@ -299,7 +297,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 20,
"metadata": {
"collapsed": false
},
......@@ -311,8 +309,8 @@
"loading Dark matter..\n",
"loading Stars..\n",
"loading Gas..\n",
"36844.594\n",
"[20418.88714131 17567.72033332 17124.40448217]\n",
"36837.902\n",
"[20415.17962488 17564.52714926 17121.29102275]\n",
"| r_200 = 212.70\n",
"| Diagonal matrix computed \n",
"| | 20, 0, 0|\n",
......@@ -331,7 +329,97 @@
"nucenter = nbe.real_center(myhydro.dm.pos3d[zoom_reg], myhydro.dm.mass[zoom_reg])\n",
"print nucenter\n",
"myhydro.center_shift(nucenter)\n",
"myhydro.r_virial(600,n=25)\n"
"myhydro.r_virial(600,n=2)\n"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"pos_dm = np.array(myhydro.dm.pos3d.reshape(len(myhydro.dm.pos3d)*3),dtype=np.float32)\n",
"pos_gs = np.array(myhydro.gs.pos3d.reshape(len(myhydro.gs.pos3d)*3),dtype=np.float32)\n",
"pos_st = np.array(myhydro.st.pos3d.reshape(len(myhydro.st.pos3d)*3),dtype=np.float32)\n",
"pos = np.concatenate((pos_dm, pos_st))#, pos_gs))\n",
"mass = np.concatenate((myhydro.dm.mass,myhydro.st.mass))#,myhydro.gs.mass))\n",
"v = np.concatenate((myhydro.dm.v,myhydro.st.v))#,myhalo.gs.v))\n"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"pos3d = pos.reshape(len(pos)/3,3)\n",
"r = np.sqrt(pos3d[:,0]**2 + pos3d[:,1]**2 +pos3d[:,2]**2)\n",
"inside_halo = np.where(r<(myhydro.r200))\n",
"r_sorted = np.argsort(r)\n",
"M_i = np.cumsum(mass[r_sorted]) - mass[r_sorted]\n",
"m_i = mass[r_sorted]\n",
"r_i = r[r_sorted]*(1e-2*myhydro.p.pctocm)# in km\n",
"U = np.sum(-myGkm*M_i*m_i/r_i)\n"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-4.1098533e+16"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"U\n"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.330e+13\n"
]
}
],
"source": [
"gas_in = np.where(myhydro.gs.r<myhydro.r200)\n",
"mH= 1.66e-24\n",
"gamma = 1.66\n",
"temp = ((1e6 * mH /1.38e-23)*myhydro.p.simutokms**2*myhydro.gs.temp)*(gamma-1)/myhydro.gs.rho\n",
"print \"{0:.3e}\".format(np.sum(temp[gas_in]))\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"print tem"
]
},
{
......@@ -488,7 +576,7 @@
},
"outputs": [],
"source": [
"K_thermal_gas = np.sum(myhalo.gs.mass[myhalo.gs.r<myhalo.r200]*myhalo.gs.temp[myhalo.gs.r<myhalo.r200])*(3./2.)"
"K_thermal_gas = np.sum(myhydro.gs.mass[myhalo.gs.r<myhalo.r200]*myhalo.gs.temp[myhalo.gs.r<myhalo.r200])*(3./2.)"
]
},
{
......
%% Cell type:code id: tags:
``` python
%matplotlib notebook
%load_ext autoreload
%autoreload 2
```
%% Cell type:code id: tags:
``` python
from scipy.stats import rv_continuous
from scipy.special import gamma
import numpy as np
import emcee
from mpl_toolkits.axes_grid1 import make_axes_locatable
from numpy import exp, sqrt
from scipy.integrate import quad, dblquad, simps
from scipy.stats import rv_continuous
from scipy.special import gamma
from scipy.interpolate import interp1d
from scipy.integrate import quad
import scipy.optimize as optimize
import matplotlib.pyplot as plt
import matplotlib as mpl
from sklearn.neighbors import KDTree
import sys
import lmfit
from py_unsio import *
import pymc
import os
from pymodelfit import FunctionModel1DAuto
import wkbl
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
import wkbl.astro.nbody_essentials as nbe
import cfalcon
CF =cfalcon.CFalcon()
import iminuit
from iminuit import Minuit, describe, Struct
import probfit
import warnings
from matplotlib.colors import LogNorm
warnings.filterwarnings('ignore')
```
%% Cell type:code id: tags:
``` python
path = "/data/OWN/DMO/mochima2_Z5/output_00041"
#path = "/media/arturo/ARTUROTECA/OUTPUTS/HaloB/output_00417"
myDMO = wkbl.Galaxy_Hound(path)
print "centering"
zoom_reg = np.where(myDMO.dm.mass == myDMO.dm.mass.min())
nucenter = nbe.real_center(myDMO.dm.pos3d[zoom_reg], myDMO.dm.mass[zoom_reg])
myDMO.center_shift(nucenter)
myDMO.r_virial(600)
print "done r200 = {0}".format(myDMO.r200)
myDMO.redefine(1)
myGkm = 6.673e-11*(1e-3**3)*myDMO.p.msuntokg#km^ 3 Msun^-1 s^-2
```
%%%% Output: stream
loading Dark matter..
centering
done r200 = 227.9296875
done r200 = 205.6640625
%% Cell type:code id: tags:
``` python
ok,myDMO.dm.rho,_= CF.getDensity(np.array(myDMO.dm.pos3d.reshape(len(myDMO.dm.pos3d)*3),dtype=np.float32), myDMO.dm.mass)
```
%% Cell type:markdown id: tags:
# $2E_{kin}$
%% Cell type:code id: tags:
``` python
K = np.sum(myDMO.dm.mass*(myDMO.dm.v)**2)
print "2E_kin = {0:1.4e} m_sun kms² s⁻²".format(K)
```
%%%% Output: stream
2E_kin = 3.0329e+16 m_sun kms² s⁻²
2E_kin = 2.4945e+16 m_sun kms² s⁻²
%% Cell type:markdown id: tags:
# $E_{pot}$
%% Cell type:code id: tags:
``` python
r_sorted = np.argsort(myDMO.dm.r)
M_i = np.cumsum(myDMO.dm.mass[r_sorted]) - myDMO.dm.mass[r_sorted]
m_i = myDMO.dm.mass[r_sorted]
r_i = myDMO.dm.r[r_sorted]*(1e-2*myDMO.p.pctocm)# in km
U = np.sum(-myG*M_i*m_i/r_i)
fi = np.where(r_i<0.19)
print fi
print "first simplification from Shapiro2004\n E_pot = {0:1.4e} m_sun km² s⁻²".format(U)
```
%%%% Output: stream
%%%% Output: error
(array([], dtype=int64),)
first simplification from Shapiro2004
E_pot = -3.9727e+16 m_sun km² s⁻²
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-6-046a68d97f3b> in <module>()
3 m_i = myDMO.dm.mass[r_sorted]
4 r_i = myDMO.dm.r[r_sorted]*(1e-2*myDMO.p.pctocm)# in km
----> 5 U = np.sum(-myG*M_i*m_i/r_i)
6 fi = np.where(r_i<0.19)
7 print fi
NameError: name 'myG' is not defined
%% Cell type:code id: tags:
``` python
print myGkpc
```
%%%% Output: stream
4.53758186497e-39
%% Cell type:code id: tags:
``` python
print myGkpc
```
%%%% Output: stream
4.53758186497e-39
%% Cell type:code id: tags:
``` python
myGkm = 6.673e-11*(1e-3**3)*myDMO.p.msuntokg#km^ 3 Msun^-1 s^-2
myGkpc = myGkm / myDMO.p.kpctokm**3 #kpc^ 3 Msun^-1 s^-2
```
%% Cell type:code id: tags:
``` python
pos = np.array(myDMO.dm.pos3d.reshape(len(myDMO.dm.pos3d)*3),dtype=np.float32)
ok, acc, Phy = CF.getGravity(pos,myDMO.dm.mass,0.090,G=myGkpc)
```
%%%% Output: error
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-7-48d0e15a70bb> in <module>()
1 pos = np.array(myDMO.dm.pos3d.reshape(len(myDMO.dm.pos3d)*3),dtype=np.float32)
----> 2 ok, acc, Phy = CF.getGravity(pos,myDMO.dm.mass,0.090,G=myGkpc)
NameError: name 'myGkpc' is not defined
%% Cell type:code id: tags:
``` python
np.sum(Phy*myDMO.p.kpctokm**2)
```
%%%% Output: execute_result
-359909900000.0
%% Cell type:code id: tags:
``` python
np.sum(Phy)
```
%%%% Output: execute_result
-3.7791042e-22
%% Cell type:code id: tags:
``` python
myDMO.p.kpctokm
```
%%%% Output: execute_result
3.086e+16
%% Cell type:markdown id: tags:
# Hydro
%% Cell type:code id: tags:
``` python
#halo = HALOBHydro(where="home")
pathsim = "/data/OWN/SF1test/SF0/mstar1_T3600/output_00041"
myhydro = wkbl.Galaxy_Hound(pathsim)
print myhydro.dm.pos3d[:,0].max()
zoom_reg = np.where(myhydro.dm.mass==myhydro.dm.mass.min())
nucenter = nbe.real_center(myhydro.dm.pos3d[zoom_reg], myhydro.dm.mass[zoom_reg])
print nucenter
myhydro.center_shift(nucenter)
myhydro.r_virial(600,n=25)
myhydro.r_virial(600,n=2)
```
%%%% Output: stream
loading Dark matter..
loading Stars..
loading Gas..
36844.594
[20418.88714131 17567.72033332 17124.40448217]
36837.902
[20415.17962488 17564.52714926 17121.29102275]
| r_200 = 212.70
| Diagonal matrix computed
| | 20, 0, 0|
| D =| 0, 14, 0|
| | 0, 0, 4|
%% Cell type:code id: tags:
``` python
pos_dm = np.array(myhydro.dm.pos3d.reshape(len(myhydro.dm.pos3d)*3),dtype=np.float32)
pos_gs = np.array(myhydro.gs.pos3d.reshape(len(myhydro.gs.pos3d)*3),dtype=np.float32)
pos_st = np.array(myhydro.st.pos3d.reshape(len(myhydro.st.pos3d)*3),dtype=np.float32)
pos = np.concatenate((pos_dm, pos_st))#, pos_gs))
mass = np.concatenate((myhydro.dm.mass,myhydro.st.mass))#,myhydro.gs.mass))
v = np.concatenate((myhydro.dm.v,myhydro.st.v))#,myhalo.gs.v))
```
%% Cell type:code id: tags:
``` python
pos3d = pos.reshape(len(pos)/3,3)
r = np.sqrt(pos3d[:,0]**2 + pos3d[:,1]**2 +pos3d[:,2]**2)
inside_halo = np.where(r<(myhydro.r200))
r_sorted = np.argsort(r)
M_i = np.cumsum(mass[r_sorted]) - mass[r_sorted]
m_i = mass[r_sorted]
r_i = r[r_sorted]*(1e-2*myhydro.p.pctocm)# in km
U = np.sum(-myGkm*M_i*m_i/r_i)
```
%% Cell type:code id: tags:
``` python
U
```
%%%% Output: execute_result
-4.1098533e+16
%% Cell type:code id: tags:
``` python
gas_in = np.where(myhydro.gs.r<myhydro.r200)
mH= 1.66e-24
gamma = 1.66
temp = ((1e6 * mH /1.38e-23)*myhydro.p.simutokms**2*myhydro.gs.temp)*(gamma-1)/myhydro.gs.rho
print "{0:.3e}".format(np.sum(temp[gas_in]))
```
%%%% Output: stream
2.330e+13
%% Cell type:code id: tags:
``` python
print tem
```
%% Cell type:code id: tags:
``` python
myGkm = 6.673e-11*(1e-3**3)*myhydro.p.msuntokg#km^ 3 Msun^-1 s^-2
#"""
print "done r200 = {0}".format(myhydro.r200)
pos_dm = np.array(myhydro.dm.pos3d.reshape(len(myhydro.dm.pos3d)*3),dtype=np.float32)
pos_gs = np.array(myhydro.gs.pos3d.reshape(len(myhydro.gs.pos3d)*3),dtype=np.float32)
pos_st = np.array(myhydro.st.pos3d.reshape(len(myhydro.st.pos3d)*3),dtype=np.float32)
pos = np.concatenate((pos_dm, pos_st))#, pos_gs))
mass = np.concatenate((myhydro.dm.mass,myhydro.st.mass))#,myhydro.gs.mass))
v = np.concatenate((myhydro.dm.v,myhydro.st.v))#,myhydro.gs.v))
pos3d = pos.reshape(len(pos)/3,3)
r = np.sqrt(pos3d[:,0]**2 + pos3d[:,1]**2 +pos3d[:,2]**2)
r_sorted = np.argsort(r)
M_i = np.cumsum(mass[r_sorted]) - mass[r_sorted]
m_i = mass[r_sorted]
r_i = r[r_sorted]*(1e-2*myhydro.p.pctocm)# in km
U = np.sum(-myGkm*M_i*m_i/r_i)
inside_halo = np.where(r<(myhydro.r200))
kmtokpc = 1 / 3.08567758128e+16
```
%%%% Output: stream
done r200 = 212.6953125
%% Cell type:code id: tags:
``` python
np.sum(mass[inside_halo]*(v[inside_halo])**2) /2.
```
%%%% Output: execute_result
2.124800100066088e+16
%% Cell type:code id: tags:
``` python
kgofHtomol = 992.122
msunohHtomol = kgofHtomol*myhydro.p.msuntokg
n = myhydro.gs.mass
print np.sum(myhydro.gs.mass[myhydro.gs.r<myhydro.r200]*myhydro.gs.temp[myhydro.gs.r<myhydro.r200])*(3./2.)
myhydro.p.k_boltz
```
%%%% Output: stream
6.099869749582234e+16
%%%% Output: execute_result
6.908632733532155e-60
%% Cell type:code id: tags:
``` python
K = (np.sum(mass[inside_halo]*(v[inside_halo])**2) /2. ) + (np.sum(n[myhydro.gs.r<myhydro.r200]*myhydro.gs.temp[myhydro.gs.r<myhydro.r200])*(3./2.))
2*K/U
```
%%%% Output: execute_result
-0.7708812981406286
%% Cell type:code id: tags:
``` python
(3./2.)*myhydro.p.kB*np.sum(myhydro.gs.temp[myhydro.gs.r<myhydro.r200])
```
%%%% Output: execute_result
1.5040020737518434e-74
%% Cell type:code id: tags:
``` python
K_thermal_gas = np.sum(myhalo.gs.mass[myhalo.gs.r<myhalo.r200]*myhalo.gs.temp[myhalo.gs.r<myhalo.r200])*(3./2.)
K_thermal_gas = np.sum(myhydro.gs.mass[myhalo.gs.r<myhalo.r200]*myhalo.gs.temp[myhalo.gs.r<myhalo.r200])*(3./2.)
```
%% Cell type:code id: tags:
``` python
q = (np.sum(mass[inside_halo]*(v[inside_halo])**2) / U ) + 1
```
......
Supports Markdown
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