posterior module

Functions for plotting posterior distributions.

posterior.cf_posts(log_like_filemask, contour_levels_sig, n_bins, colours, linestyles, ellipse_check=False, plot_save_path=None)

Plot w0-wa joint posteriors from the full-sky correlation function for different numbers of theta bins.

Parameters
  • log_like_filemask (str) – Path to log-likelihood files as output by loop_likelihood_nbin.like_cf_gauss_loop_nbin, with placeholder for {n_bin}.

  • contour_levels_sig (list) – List or other sequence of integer contour sigma levels to plot.

  • n_bins (list) – 2D nested list of numbers of theta bins to plot. The top-level list defines the panels; the inner lists are the different numbers of theta bins to plot within each panel. For example, [[30, 5], [30, 10], [30, 20]] will produce three panels showing 5, 10, and 20 theta bins, with all panels also showing 30 bins. There must be the same number of numbers of theta bins within each panel.

  • colours (list) – List of matplotlib colours, corresponding to the different numbers of theta bins within each panel. All panels will use the same colours.

  • linestyles (list) – Like colours, but matplotlib linestyles.

  • ellipse_check (bool, optional) – This function uses ellipse-fitting to overcome sampling noise. If ellipse_check is set to True, the raw posterior will be plotted as well as the fitted ellipse, to check the fit. Default False.

  • plot_save_path (str, optional) – Path to save the figure, if supplied. If not supplied, figure will be displayed.

posterior.cl_posts(log_like_filemask, contour_levels_sig, n_bps, colours, linestyles, ellipse_check=False, plot_save_path=None)

Plot w0-wa joint posteriors from the full-sky power spectrum for different numbers of bandpowers.

Parameters
  • log_like_filemask (str) – Path to log-likelihood files as output by loop_likelihood_nbin.like_bp_gauss_loop_nbin, with placeholder for {n_bp}.

  • contour_levels_sig (list) – List or other sequence of integer contour sigma levels to plot.

  • n_bps (list) – 2D nested list of numbers of bandpowers to plot. The top-level list defines the panels; the inner lists are the different numbers of bandpowers to plot within each panel. For example, [[30, 1], [30, 5], [30, 10]] will produce three panels showing 1, 5, and 10 bandpowers, with all panels also showing 30 bandpowers. There must be the same number of numbers of bandpowers within each panel.

  • colours (list) – List of matplotlib colours, corresponding to the different numbers of bandpowers within each panel. All panels will use the same colours.

  • linestyles (list) – Like colours, but matplotlib linestyles.

  • ellipse_check (bool, optional) – This function uses ellipse-fitting to overcome sampling noise. If ellipse_check is set to True, the raw posterior will be plotted as well as the fitted ellipse, to check the fit. Default False.

  • plot_save_path (str, optional) – Path to save the figure, if supplied. If not supplied, figure will be displayed.