frb.dm.cosmic

Utility pieces for DM calculations

frb.dm.cosmic.DMcosmic_PDF(Delta, C0, sigma, A=1.0, alpha=3.0, beta=3.0)[source]

PDF(Delta) following the McQuinn formalism describing the DM_cosmic PDF

See Macquart+2020 for details

Args:
  • Delta (float or np.ndarray) – DM / averageDM values

  • C0 (float) – parameter

  • sigma (float)

  • A (float, optional)

  • alpha (float, optional)

  • beta (float, optional)

Return type:

float or np.ndarray

frb.dm.cosmic.deviate1(C0, sigma, beta, orig=False)[source]

Calculate deviate to solve fo C0

Args:
  • C0 (float)

  • sigma (float)

  • beta (float)

  • orig (bool, optional) – use the original approach. Not recommended

Returns:

deviate

Return type:

float

frb.dm.cosmic.build_C0_spline(max_log10_sigma=0.0, npt=100, ret_all=False, beta=4.0)[source]

Generate a spline of C0 vs sigma values for the McQuinn formalism

Args:
  • max_log10_sigma (float, optional)

  • npt (int, optional)

  • ret_all (bool, optional) – if True, return more items

  • beta (float, optional)

Returns:

If ret_all, return f_C), sigmas, COs else return the spline

Return type:

float or tuple

frb.dm.cosmic.grab_sigma_spline()[source]

Load up the sigma spline

Args:

redo

Return type:

scipy.interpolate.InterpolatedUnivariateSpline

frb.dm.cosmic.grab_C0_spline(max_log10_sigma=0.0, npt=100, ret_all=False, redo=False, beta=3.0, ifile=None)[source]

Load up the C0 spline

Args:
  • max_log10_sigma

  • npt

  • ret_all

  • redo

  • beta

  • ifile

Return type:

scipy.interpolate.InterpolatedUnivariateSpline