get_mean_DM

zdm.pcosmic.get_mean_DM(zeds: ndarray, state: State, Plot=False)[source]

Compute the mean cosmic DM at given redshifts (Macquart relation).

Calculates <DM_cosmic>(z) using the IGM electron density model from the frb package. Assumes a FlatLambdaCDM cosmology with parameters from the state object.

Parameters:
  • zeds (ndarray) – Redshifts at which to compute mean DM. Must be linearly spaced and represent bin centers (e.g., 0.5*dz, 1.5*dz, 2.5*dz, …).

  • state (parameters.State) – State object containing cosmological parameters (H0, Omega_b, Omega_m).

  • Plot (bool, optional) – If True, generate diagnostic plots of DM vs z. Default is False.

Returns:

Mean cosmic DM values in pc/cm^3 at each redshift.

Return type:

ndarray

Notes

Uses frb.dm.igm.average_DM for the underlying calculation. The redshifts must be evenly spaced for correct bin assignment.