In [6]:
# import
from importlib import reload
import numpy as np
from astropy import units
from astropy.cosmology import Planck15 as cosmo
from astropy.coordinates import SkyCoord
from frb import halos
In [2]:
mnfw = halos.ModifiedNFW(alpha=2, y0=2)
In [3]:
# Mass in the halo
mnfw.M_b.to('M_sun') * mnfw.f_hot
Out[3]:
In [4]:
mnfw.r200
Out[4]:
In [5]:
Mb_check = mnfw.mass_r(mnfw.r200)
Mb_check
Out[5]:
In [6]:
Ne = mnfw.Ne_Rperp(100*units.kpc)
Ne
Out[6]:
In [7]:
Galaxy = halos.MilkyWay()
In [8]:
Galaxy.M_halo.to('M_sun')
Out[8]:
In [9]:
Galaxy.r200
Out[9]:
In [10]:
from ne2001.density import NEobject
In [11]:
# Zero out inner 10kpc of the halo where we assume the ISM domiantes
Galaxy.zero_inner_ne = 10. # kpc
In [12]:
# NE2001 parameters
params = dict(F=1., e_density=1.)
In [13]:
model_ne = NEobject(Galaxy.ne, **params)
In [14]:
l,b = 0., 90. # deg in Galactic coordinates
In [15]:
DM = model_ne.DM(l,b, Galaxy.r200.value)
DM
Out[15]:
In [16]:
#reload(halos)
m31 = halos.M31()
In [17]:
coord = SkyCoord('J004244.3+413009', unit=(units.hourangle, units.deg))
In [18]:
DM = m31.DM_from_Galactic(coord)
DM
Out[18]:
In [19]:
reload(halos)
icm = halos.ICM()
In [20]:
icm.M_b.to('M_sun') * icm.f_hot
Out[20]:
In [21]:
icm.r200
Out[21]:
In [22]:
icm.mass_r(icm.r200)
Out[22]:
In [23]:
icm.Ne_Rperp(1*units.Mpc)
Out[23]:
In [5]:
hmfe = halos.init_hmf()
In [11]:
ncom = hmfe.n_in_bins((10.**12.3 * cosmo.h, 10**16 * cosmo.h), 0.367) * cosmo.h**3
ncom
Out[11]:
In [4]:
reload(halos)
halos.halo_incidence(10.**12.3, 0.47, Mhigh=10**15, radius=28*units.kpc)
Out[4]:
In [12]:
50. / (1+0.47)
Out[12]:
In [ ]: