diffsph.utils package

Submodules

diffsph.utils.consts module

diffsph.utils.dictionaries module

diffsph.utils.tools module

diffsph.utils.tools.TB(brightness, theta, nu, *args, **kwargs)

Brightness temperature conversion

\[T_B = \frac{c^2}{2\,k\,\nu^2}I_\nu\]
Parameters:
  • brightness – generic brightness function in Jy/sr

  • theta – angular radius (as the first argument of the generic brighness function)

  • nu – frequency (as the second argument of the generic brighness function)

Returns:

brightness temperature in mK

diffsph.utils.tools.approxhalo_fd(n, theta, dist, rh)

Partial (\(\theta\)-dependent) flux-density halo/bulge factor (approximate formula):

\[\mathcal H_n(\theta) = \mathcal H_n(r_h,R) - 2\,\int_{R\sin(\theta)}^{r_h}dr\, r\, \kappa_1(r,R,\theta) \frac{\sin\left(\frac{n\pi r}{r_h}\right)}r\]

where \(R\), \(rh\) and \(n\) are, respectively the distance, halo radius and Fourier index

diffsph.utils.tools.approxhalo_fd_tot(n, dist, rh)

Total flux-density halo/bulge factor (approximate formula):

\[\mathcal H_n(r_h,R) \simeq 4\pi\int_0^{r_h}dr\, r^2 \frac{\sin\left(\frac{n\pi r}{r_h}\right)}r \ ,\]

where \(R\), \(rh\) and \(n\) are, respectively the distance, halo radius and Fourier index

diffsph.utils.tools.check_cache()

Function checks whether the /.diffsph_cache/ folder exists. If it does not exists, it creates it

Returns:

folder directory name

Return type:

str

diffsph.utils.tools.delta_float(inp)

Float number for variable 'delta'

Parameters:

inp – variable 'delta' as str ('kol', 'kra', etc.) or float

Returns:

float number associated with 'inp'

Return type:

float

diffsph.utils.tools.df(func, **kwargs)
diffsph.utils.tools.evaluate(f, x, **kwargs)

Function converts string into a python function’s name and evaluates it

Parameters:
  • f – function to be evaluated

  • x – first argument of \(f\)

Returns:

\(f(x)\)

diffsph.utils.tools.f(n, x)

Basis function in Fourier-expanded brightness formula

\[f_n(x)=2\int_x^1\frac{\sin(n\pi y) dy}{\sqrt{y^2-x^2}}\]
Returns:

\(f_n\) as a function of \(x\)

diffsph.utils.tools.fwhm(brightness, thmax, *args, **kwargs)

Full width at half maximum

Parameters:
  • brightness – generic brightness function

  • thmax – signal’s angular radius

Returns:

Full width at half maximum in arcmin

diffsph.utils.tools.g(n, x)

Basis function in Fourier-expanded flux density formula

\[g_n(x)=2\int_x^1\sqrt{y^2-x^2}\sin(n\pi y) dy\]
Returns:

\(g_n\) as a function of \(x\)

diffsph.utils.tools.halo_fd(n, theta, dist, rh)

Partial (\(\theta\)-dependent) flux-density halo/bulge factor:

\[\mathcal H_n(\theta) = \mathcal H_n(r_h,R) - 2\,\int_{R\sin(\theta)}^{r_h}dr\, r\, \kappa_1(r,R,\theta) \frac{\sin\left(\frac{n\pi r}{r_h}\right)}r \ ,\]

where \(R\), \(rh\) and \(n\) are, respectively the distance, halo radius and Fourier index

diffsph.utils.tools.halo_fd_tot(n, dist, rh)

Total flux-density halo/bulge factor:

\[\mathcal H_n(r_h,R) = 2\,\int_0^{r_h}dr\, r\, \kappa_0(r,R) \frac{\sin\left(\frac{n\pi r}{r_h}\right)}r\ , \]

where \(R\), \(rh\) and \(n\) are, respectively the distance, halo radius and Fourier index

Returns:

Halo flux-density factor

diffsph.utils.tools.hfd(fluxdens, thmax, *args, **kwargs)

Half-flux diameter

Parameters:
  • brightness – generic brightness function

  • thmax – signal’s angular radius

Returns:

Half-flux diameter in arcmin

diffsph.utils.tools.hypothesis_index(hyp)

Index of the hypothesis (1 for decaying DM or generic scenario, 2 for WIMP self-annihilation).

Parameters:

hyp (str) – hypothesis: 'wimp', 'decay' or 'generic')

Returns:

hypothesis index

Return type:

int

diffsph.utils.tools.ker_0(r, dist)
\[\kappa_0(r,R) = \frac1{R}\log\sqrt{\frac{R+r}{R-r}}\]
diffsph.utils.tools.ker_1(r, theta, dist)
\[\kappa_1(\theta,r,R) = \frac1{R}\log\frac{R\cos\theta+\sqrt{r^2-R^2\sin^2\theta}}{\sqrt{R^2-r^2}}\]
diffsph.utils.tools.load_data(folder)

Function loads data from folder

Returns:

data organized in form of a python dictionary

Return type:

dict

diffsph.utils.tools.sort_kwargs(**kwargs)

Function sorts keyword arguments alphabetically

Returns:

sorted keywords with corresponding entries

Return type:

dict

diffsph.utils.tools.var_to_str(inp)

Dictionary for variables 'delta', 'hyp', 'galaxy', 'ref' and 'rad_temp'

Parameters:

inp – input string or number

Returns:

default variable name

Return type:

str

Module contents