snorer.nx

snorer.nx(r,mx,is_spike=False,**kwargs)

Dark matter number density of Milky Way of Large Magellanic Cloud at distance \(r\) to the galactic center. Spike feature is not included.

Parameters:

r : array_like
    Distance to galactic center \(r\), kpc

mx : array_like
    Dark matter mass, MeV

is_spike : bool
    Is halo spike included? Default is False.

**kwargs
     Keyword arguments for characteristic parameters of NFW profile and spike halo, . If is_spike = False, the parameters for configuring spiky halo will be deactivated. Default values assume Milky Way. See default arguments in snorer.params.halo and snorer.params.spike.

Returns:

out : scalar/ndarray
    Dark matter number density at \(r\), cm−3

Examples

Let's plot \(n_\chi(r)\) for different profiles.

import numpy as np
import matplotlib.pyplot as plt
import snorer as sn

mx = 0.01
# radius, kpc
r_vals = np.logspace(-3,2,100)
# profiles
profiles = [sn.constant.MW_profile,sn.constant.LMC_profile]
labels = ['MW','LMC']

# Make plot
for i in range(2):
    rhos,rs,n,_,_ = profiles[i].values()
    nx_vals = sn.nx(r_vals,mx,rhos=rhos,rs=rs,n=n)
    plt.plot(r_vals,nx_vals,label=labels[i])
plt.xscale('log')
plt.yscale('log')
plt.xlabel(r'$r$ [kpc]')
plt.ylabel(r'$n_\chi(r)$ [cm$^{-3}$]')
plt.title(fr'$m_\chi = {mx:.2f}$ MeV')
plt.legend()
plt.show()
nx2

Notes

Number density is just density divided by mass, $$ n_\chi(r)=\frac{\rho_\chi(r)}{m_\chi}. $$ See also snorer.rhox.