get_pDM_grid
- zdm.pcosmic.get_pDM_grid(state: State, DMgrid, zgrid, C0s, verbose=False, zlog=False)[source]
Generate a 2D grid of p(DM|z) probabilities.
Computes the probability distribution of cosmic DM for each redshift in the grid. This is the main function for building z-DM grids.
- Parameters:
state (parameters.State) – State object containing cosmological and IGM parameters.
DMgrid (ndarray) – DM values (bin centers) for the output grid, in pc/cm^3.
zgrid (ndarray) – Redshift values for the output grid.
C0s (ndarray) – Pre-computed C0 normalization constants for each redshift.
verbose (bool, optional) – If True, print diagnostic information. Default is False.
zlog (bool, optional) – If True, zgrid is log-spaced. If False (default), linearly spaced.
- Returns:
2D array of shape (len(zgrid), len(DMgrid)) containing normalized p(DM|z) values. Each row sums to 1.
- Return type:
ndarray